Google Authentication isssue providerAccountId is undefined after successful login #10891
Replies: 3 comments 1 reply
-
My theory is correct, problem is that providerAccountId is not populated with my google provider. I checked that by recreating the process, but after 'A' sign in , I wrote manually in the database a random string in the providerAccountId field. Any guess where this might come? |
Beta Was this translation helpful? Give feedback.
-
Weirdly enough , this is related to calling profile() |
Beta Was this translation helpful? Give feedback.
-
Hello,
I've encountered an issue with OAuth login functionality on my website. I've implemented both GitHub and Google login methods. While GitHub login is working smoothly, I'm facing a peculiar problem with Google login.
Here's the scenario:
After clearing all user, session, and account tables in the database, I log in using my Gmail account 'A', and everything works as expected. A new user, account, and session are created successfully.
Next, I sign out and attempt to log in with Gmail account 'B'. Upon selection of Gmail account 'B' I am redirected back to my website somehow successfully, but here's the issue: it identifies me as Gmail account 'A'.
From database point of view, it created a new session for the same user 'A', which is quite unexpected. (also no new account or user is created)
What I have observed also is that the "providerAccountId" in the account table is undefined (maybe leading to wrong equivalence..,)
Has anyone else encountered this issue with the latest beta version of NextAuth.js? I'm using Drizzle, NextAuth, and Next.js for my application.
Your insights would be greatly appreciated :)
Beta Was this translation helpful? Give feedback.
All reactions