fix(auth): emit AuthResult on sign-in success and fix MFA tooltip auto-open#2326
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the authentication state management to provide more detailed feedback upon successful sign-in. Specifically, it introduces updateAuthStateWithResult in FirebaseAuthUI to transition the state to AuthState.Success (including AuthResult and user details) rather than simply returning to Idle. These changes are propagated across Anonymous, Email, and OAuth providers, with corresponding updates to unit tests. The PR also includes UI adjustments to tooltip visibility. Feedback was provided to revert the USE_AUTH_EMULATOR flag in the demo app to false to ensure it remains functional for users without a local emulator setup.
mikehardy
left a comment
There was a problem hiding this comment.
I don't appear to have the ability to resolve my comment threads but I consider them resolved now. I'm also not sure if I have repo-authority such that my approval counts but it was a real review :-). +1, looks good
Closes #2318 .
All providers called
updateAuthState(Idle)after sign-in, so the onlyAuthState.Successcame from Firebase'sAuthStateListenerwhich never carries anAuthResult. Theresult?.letguard inFirebaseAuthScreenthen silently blockedonSignInSuccessevery time.Fix: emit
AuthState.Successwith the realAuthResultvia a sharedupdateAuthStateWithResult()helper. Also fixes MFA tooltip auto-opening when disabled.