Replies: 3 comments
-
I think it can have something to do with the adapter. The CMS delivers correct data. But Do I need adapter anyway? Without it I created a new user in my CMS database with the call to EDIT: After I deleted all data for |
Beta Was this translation helpful? Give feedback.
-
Yeah so the users with the same email address at different providers are not linked automatically. See the explanation in the FAQ. Also see the discussion (#3936 (comment) - From that post down) for some more background info. The Account is, however, linked to the same User if attempting to sign-in with a new "Account" (OAuth provider) with the same email address only if already signed in with another provider, out of security reasons. Therefore, my guess at whats going on in your case is that the user initially signed in with Google, for example, and created a Then the user signed in with Fcaebook with that same email address, which linked that new |
Beta Was this translation helpful? Give feedback.
-
I think it not quite exactly what happened as I logged in with a user with a duplicated email address (say using Facebook) but I didn’t get the other user with that email (say using Google) but instead a one completely not related with both accounts. Perhaps it had something to do with changing options for database connection string (I tried out One gotcha: in database CMS users from CMS and those from NextAuth are not related, so if I delete a user in CMS, he stays in NextAuth table. But those users were created at the same time in |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Question 💬
Hi, I have two providers: Facebook and Google connected to Strapi CMS. I used Google with two different users and Facebook with one user, which has the same e-mail as one of Google's users. In Strapi all users were correctly saved.
Then in my frontend if I sign in using Google provider, I get the correct user. Everything works just fine. But with Facebook provider the session loads every time the wrong user and every time it's the one, which has the different email and has no Facebook account at all. I have tried to log in and log out with all the users in the different order but the results are all the time the same.
I test it in development mode.
In Strapi I have this user:
What's a bit odd is the fact that in debug mode I can see that Oauth gets the correct Facebook user but at the same time if I console log
user
andaccount
Objects from thejwt
callback, then I get the incorrect user and token (Bar | [email protected]
) and the correct account (Fiz | foo.gmail.com
)Nextauth optios look like this:
My environment:
How to reproduce ☕️
You need to have Google account and Facebook account with the same e-mail. Additionally, you need another Google account with a different e-mail address. Log-in with all of them and see that Google account will be correctly loaded in the session but the Facebook account won't and session will load Google account with the different e-mail.
Contributing 🙌🏽
No, I am afraid I cannot help regarding this
Beta Was this translation helpful? Give feedback.
All reactions