Back

[SOLVED] OAuth issue with NextJS

  • 0
  • Accounts
  • Web
  • Cloud
Ankan
9 Jul, 2023, 16:50

I am using appwrite oauth with next js 13. And after successful login appwrite is unable to set cookie or credentials. Now when I try to get user it gets an error. But this whole procedure is successful when using the browser that I used to create the appwrite account.

TL;DR
Title: [SOLVED] OAuth issue with NextJS Solution: The issue was caused by 3rd party cookies being blocked. To fix it, the user can change their browser settings to allow 3rd party cookies or set domains to make the Appwrite cookie a 1st party cookie. More information can be found at <https://appwrite.io/docs/custom-domains>.
Drake
9 Jul, 2023, 18:56

Your problem is probably 3rd party cookies being blocked. You can try to change your browser settings to allow 3rd party cookies or set domains to make the Appwrite cookie a 1st party cookie

Ankan
9 Jul, 2023, 19:48

actually was wondering how can we let appwrite set first party cookie

Drake
9 Jul, 2023, 19:50

See https://appwrite.io/docs/custom-domains.

Keep in mind, this will only work client side because your server side won't have the cookie

Ankan
9 Jul, 2023, 19:50

Hmmm got it

Ankan
9 Jul, 2023, 20:07

Actually this way it worked out. And thank you very much for the help😊😊

Drake
9 Jul, 2023, 20:08

[SOLVED] OAuth issue with NextJS

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more