joelbutcher / socialstream

OAuth for Laravel, simplified.

Home Page:https://docs.socialstream.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[bug] This Google sign in account is already associated with your user.

eyalgrossdev opened this issue · comments

Describe the bug
When logging in using a gmail address that already exists in the system (created originally by logging in using Google) I am successfully logged in but redirected to the /user/profile/ page with the following error - "This Google sign in account is already associated with your user."

To Reproduce
See above

Expected behavior
Logged in without error

Screenshots
image

Environment context

  • Socialstream version: 3.8
  • Jetstream stack: Livewire
  • Laravel version: 9.19
  • PHP version: 8.0.23

@eyalgrossdev what features have you got enabled in your socialstream.php config file?

Thanks for the reply @joelbutcher. Here are the features enabled...

'features' => [
   Features::createAccountOnFirstLogin(),
   // Features::generateMissingEmails(),
   Features::rememberSession(),
   Features::providerAvatars(),
   Features::loginOnRegistration(),
],

Oh, is it because of the createAccountOnFirstLogin feature? It thinks every time I login it's the first time? Could this be due to having to start my server (Laragon) every time I boot? Does it 'forget' if it's the first time or not?

I just verified that the first time I login after booting up my server the issue occurs, then if I sign out and sign back in (always with Google login) the issue does not occur.

"Problem" solved?

@eyalgrossdev this error will occur if you've previously logged in with that Google account with createAccountOnFirstLogin enabled before signing up with another email address – either via email or via another SSO provider associated with a different email address.

When you inspect the database is the Google account you're trying to link up (the one already connected to another account) associated to a different email than the Laravel user you're trying to connect it up to?

Closing this due to inactivity