Skip to content
Back

Google OAuth2 creates second identity instead of new user

  • 0
  • Self Hosted
  • Flutter
  • Android
  • Auth
YahalomS
9 Mar, 2025, 07:51

Self-hosted 1.6.0 / Flutter

I am facing a strange problem. I was working with a user created with Google OAuth2, it was registered in the Authentication environment perfectly and all working smooth.

But , when I sign out and try to create a new User with a different email address (again with OAuth2 , Google), instead of creating a new User for that email address, it actually adds a 2nd identity to the same existing User , even after I have completely signed out , deleted the session, cleared the object in the listener.

I cannot understand why it happens , but as a workaround, I tried to locate the second identity in the User and delete it, but when I try to query the identities of the user with users.listIdentities (from dart_appwrite Users API), I get error 401 (role: guests).

Just to clarify , the API key has Users full permissions.

TL;DR
Google OAuth2 causing issue where attempting to create a new user with a different email address adds a second identity to the existing user instead. Workaround is to delete the second identity. Querying identities with users.listIdentities returns error 401.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more