-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Description
Describe the bug
Implementing a feature that requires the user to reAuthenticate.
I am handling the PlatformExceptions thrown by the FirebaseUser.reauthenticateWithCredential in order to catch and gracefully handle the errors such as ERROR_WRONG_PASSWORD.
However if the user enters an email that doesn't exist, my error handler receives a ERROR_USER_NOT_FOUND then Firebase logs the user out. Thus trigger my onAuthStateChanged handler. Is this a bug? Or a feature built in for security reasons? According to the docs, the reauthenticateWithCredential method shouldn't trigger a log out event.
To Reproduce
Attain the currently logged in user, then call reauthenticateWithCredential with a credential that points to an email that doesn't exist. Observe that Firebase then logs out.
Expected behavior
I don't believe it should be logging out the user on an incorrect re authentication attempt.
Additional context
Dependencies
firebase_auth 0.15.3.
firebase_core 0.4.3+1