fix(auth): log out before Facebook sign-in to clear stale cached token#2322
Open
demolaf wants to merge 3 commits into
Open
fix(auth): log out before Facebook sign-in to clear stale cached token#2322demolaf wants to merge 3 commits into
demolaf wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds a logOut() call to the Facebook sign-in flow to prevent stale token issues and includes a unit test for verification. The reviewer identified that the current placement of the logOut() call is likely too late to affect the current sign-in attempt and should be moved to the launcher. Furthermore, there is an inconsistency in the use of the login manager provider that should be addressed to ensure correct behavior when using test overrides.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #879
When a user switches accounts in the native Facebook app without signing out of FirebaseUI, the Facebook SDK retains a stale cached token. On the next sign-in attempt this caused a silent failure with "User logged in as different Facebook user".
Calling logOut() at the start of signInWithFacebook clears the local token cache before each sign-in, forcing a fresh authentication.