Issue re-signing in with Google after logout
Hi everyone,
I’m having an issue with the Google login. The first time a user signs in with Google, everything works perfectly the account gets created, cookies are set, and the redirect works. But after logging out and trying to sign in again with the same Google account, I get this error: SERVER_ERROR: [TypeError: Cannot read properties of undefined (reading 'accountId')]
It happens right after Google redirects back to /api/auth/callback/google. It looks like Better Auth is trying to link the account again, but accountId ends up being undefined. If I delete the record from the accounts table and try again, it works fine, but once I log out and re-login, the same error comes back.
Has anyone else seen this or found a fix for it?
I’m having an issue with the Google login. The first time a user signs in with Google, everything works perfectly the account gets created, cookies are set, and the redirect works. But after logging out and trying to sign in again with the same Google account, I get this error: SERVER_ERROR: [TypeError: Cannot read properties of undefined (reading 'accountId')]
It happens right after Google redirects back to /api/auth/callback/google. It looks like Better Auth is trying to link the account again, but accountId ends up being undefined. If I delete the record from the accounts table and try again, it works fine, but once I log out and re-login, the same error comes back.
Has anyone else seen this or found a fix for it?
