[UI AUTH] Multiple anonymous user prevent OAuth signin #11267
Unanswered
Somebody25
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I created an app where a anonymous user is present per default. If someone downloads the app fresh, an anonymous user is created on startup and also on each logout.
This now seems to prevent a user to login with OAuth, Google for example. I can sign up using Google fine for the first time, if the user does not exist in Firebase and the anonymous user is linked as expected. If I now sign out or try to login on another device with Google I get the error: 'The provider is associated with a different user account'. The underlying error is FirebaseAuthException with code 'credential-already-in-use'.
I suspect this is because there is already one anonymous user liked to the Google account. My idea of fixing this issue would be to listen on AuthStateChangeAction, catch the exception and reprocess the request, not as account linking but as normal signIn.
I tried this code snipped but without success, hopefully someone can help me how to reprocess the signIn request
Beta Was this translation helpful? Give feedback.
All reactions