Any working example for nextjs using google Oauth? I struggle in the last week to create progress
- 0
- Web
I was able to add users, but it won't get in to the callback of success.
It throws:
Error fetching user: AppwriteException: User (role: guests) missing scope (account)
It's self-hosted with coolify (1.4)- the google console is configured. I tried to give it localhost "http://localhost:3000/callback" endpoint
Any working example for a dashboard (behind login with google) that serve api function in appwrite? it will be great start. I scanned all the internet and didn't found something good.
are you using server side rendering? That could be a problem because a session would be created client side which doesn't exist server side
I tried both, are you familiare with minimal working example?
or maybe i should use it only with REACT instead of nextjs project?
It would be best to avoid using SSR.
Besides that, another problem you could be facing is 3rd party cookies. To fix that, you can enable 3rd party cookies in your browser or configure custom domains https://appwrite.io/docs/custom-domains
Thanks for the tips! I'll try them. is there anyway to monitor that this is the problem?
check the network request in the browser network logs and in the cookies tab for the api call. you may see that the browser says some are blocked due to 3rd party cookie
is that a symptom for that? Status 401 Unauthorized VersionHTTP/2 Transferred1.15 kB (122 B size) Referrer Policystrict-origin-when-cross-origin DNS ResolutionSystem
(it is from my host in XX.my-domain.com where appwrite is selfhosted)
This is the screenshot of the logs if it might help (back...) is the appwrite on my domain
could be yes
thanks. so is there a point in working in nextjs for doing projects with nextjs? maybe just to hide the server function sometimes? maybe with payment mechanism?
maybe if you have some page that needs SEO?
or you could make use of the server routes, but you'll need ot make sure to handle sessions somehow
Yea seems right.
But tell me, how can i use the functionality of the api-key of appwrite without server side?
regarding the CNAME- what address should i put? the localhost?
The API key is only used server side. Sessions aren't used with the node SDK
It should be your domain
Recommended threads
- self-hosted auth: /v1/account 404 on saf...
Project created in React/Next.js, Appwrite version 1.6.0. Authentication works in all browsers except Safari (ios), where an attempt to connect to {endpoint}/v1...
- delete document problems
i don't know what's going on but i get an attribute "tournamentid" not found in the collection when i try to delet the document... but this is just the document...
- Update User Error
```ts const { users, databases } = await createAdminClient(); const session = await getLoggedInUser(); const user = await users.get(session.$id); if (!use...