Difficulties with NextAuth and different providers
Unanswered
French Lop posted this in #help-forum
French LopOP
Hello all, I am currently learning Next.js by building a calendar app. For this I want to interface with google calendar.
The issue I am facing is the following:
I am using NextAuth v5 with Credentials or any other provider to sign in to my app.
Later I want the possibility to authorize access to your i.e. google calendar. When trying to use a NextAuth GoogleProvider with the right scope, I am facing the issue that whenever I complete the authorization on google's page, the JWT containing my previously signed-in email, sub etc. gets replaced with the information of the account signed in with google.
I want to only get the access and refresh token from connecting google, while still keeping my original email that i used to sign in to the app (different from the google account).
Maybe I am taking a completely wrong approach or missing something entirely—I am glad about any guidance about how to set this up, as this feels like it should be fairly standard to do 🙂
One option I have read about is using an adapter and DB for this, but I would like to avoid that if possible because I find it all intimidating enough already 😅
Thank you!
The issue I am facing is the following:
I am using NextAuth v5 with Credentials or any other provider to sign in to my app.
Later I want the possibility to authorize access to your i.e. google calendar. When trying to use a NextAuth GoogleProvider with the right scope, I am facing the issue that whenever I complete the authorization on google's page, the JWT containing my previously signed-in email, sub etc. gets replaced with the information of the account signed in with google.
I want to only get the access and refresh token from connecting google, while still keeping my original email that i used to sign in to the app (different from the google account).
Maybe I am taking a completely wrong approach or missing something entirely—I am glad about any guidance about how to set this up, as this feels like it should be fairly standard to do 🙂
One option I have read about is using an adapter and DB for this, but I would like to avoid that if possible because I find it all intimidating enough already 😅
Thank you!