Skip to content

OAuthAccountNotLinked With only 1 user and 1 provider #1446

@rafiqumsieh0

Description

@rafiqumsieh0

Describe the bug
I have only 1 user in the database and am using only 1 provider, which is Google. I am using MongoDB Atlas for the database. Initial signIn works fine and the user is created in the database, and a session is created. The bug occurs when I log that user out and I try to log in again. Now, when I try to sign the user in (User record is already in the database), it redirects me to the default sign in page:

OAuthAccountNotLinked with the message : "To confirm your identity, sign in with the same account you used originally".

Every subsequent request will lead to the same result.

If I delete the user from the database, it will work fine again.

I console logged the signIn callback, and Google is returning all the necessary data.

Steps to reproduce
Set up:

Safari browser
Google Provider
MongoDB Atlas Database

Steps:
1-) Try an initial log in with Google.
2-) After a successful user creation and session creation, log out.
3-) Try logging back in.

The bug should happen at step 3.

Expected behavior
I expected the signIn with Google to work fine since the initial SignIn works fine.

Screenshots or error logs
Just that default Sign In Page

Additional context
None at the moment.

Feedback
Thanks for the great library

  • Found the documentation helpful
  • Found documentation but was incomplete
  • Could not find relevant documentation
  • Found the example project helpful
  • Did not find the example project helpful

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingincompleteInsufficient reproduction. Without more info, we won't take further actions/provide help.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions