Library version: firebase-ui-auth:10.0.0-beta02
Since View based solution is no longer maintained and my number one crash in production is listed among the other issues here, I thought I'd give the compose beta a shot.
I've let AI handle the description below - it seem to be clear enough:
What happens
onSignInSuccess is never called, even on a first-time fresh email/password sign-in with no prior session. Instead, the user sees the default "Signed in as / Manage two-factor auth / Sign out" screen with no way to proceed.
Root cause
In FirebaseAuthScreen.kt line 523:
state.result?.let { result ->
if (state.user.uid != lastSuccessfulUserId.value) {
onSignInSuccess(result)
}
}
onSignInSuccess is gated on result != null. However, authUI.authStateFlow() emits AuthState.Success(result=null, ...) even after a fresh sign-in completes. This is confirmed by the library's own debug log immediately after a successful email/password login:
Current state: AuthState.Success(result=null, user=..., isNewUser=false)
Navigation to AuthRoute.Success.route happens unconditionally (line 536–541) regardless of whether result is null, so the success screen always shows — but the caller's completion callback never fires.
How to reproduce
- Integrate FirebaseAuthScreen with only
onSignInSuccess as the completion signal.
- Launch the app with no prior Firebase session.
- Sign in with email and password.
onSignInSuccess is never called. The "Signed in as" screen is shown with no way to proceed.
Additional issue: tooltip auto-shows on the success screen
With isMfaEnabled = false in the configuration, the tooltip on the disabled "Manage two-factor auth" button auto-opens on every render because of:
// FirebaseAuthScreen.kt line 760
state = rememberTooltipState(
initialIsVisible = !configuration.isMfaEnabled
)
!false = true, so the tooltip is immediately visible. This is unexpected — a disabled feature should not announce itself to the user unprompted.
Suggested fixes
- Primary: Call
onSignInSuccess when AuthState.Success is reached regardless of whether result is null. Either pass a synthetic wrapper or add a separate onAlreadyAuthenticated: (FirebaseUser) -> Unit callback for the null-result case so callers can handle both paths with named, distinct callbacks.
- Secondary: Change
initialIsVisible = !configuration.isMfaEnabled to initialIsVisible = false — or only show the tooltip on explicit user interaction, not on initial render.
Workaround used in the meantime
Providing authenticatedContent and calling the app's own sign-in completion logic from there when authState is AuthState.Success.
Library version: firebase-ui-auth:10.0.0-beta02
Since View based solution is no longer maintained and my number one crash in production is listed among the other issues here, I thought I'd give the compose beta a shot.
I've let AI handle the description below - it seem to be clear enough:
What happens
onSignInSuccessis never called, even on a first-time fresh email/password sign-in with no prior session. Instead, the user sees the default "Signed in as / Manage two-factor auth / Sign out" screen with no way to proceed.Root cause
In
FirebaseAuthScreen.ktline 523:onSignInSuccessis gated onresult != null. However,authUI.authStateFlow()emitsAuthState.Success(result=null, ...)even after a fresh sign-in completes. This is confirmed by the library's own debug log immediately after a successful email/password login:Current state:
AuthState.Success(result=null, user=..., isNewUser=false)Navigation to
AuthRoute.Success.routehappens unconditionally (line 536–541) regardless of whether result is null, so the success screen always shows — but the caller's completion callback never fires.How to reproduce
onSignInSuccessas the completion signal.onSignInSuccessis never called. The "Signed in as" screen is shown with no way to proceed.Additional issue: tooltip auto-shows on the success screen
With
isMfaEnabled = falsein the configuration, the tooltip on the disabled "Manage two-factor auth" button auto-opens on every render because of:!false = true, so the tooltip is immediately visible. This is unexpected — a disabled feature should not announce itself to the user unprompted.
Suggested fixes
onSignInSuccesswhenAuthState.Successis reached regardless of whether result is null. Either pass a synthetic wrapper or add a separateonAlreadyAuthenticated: (FirebaseUser) -> Unitcallback for the null-result case so callers can handle both paths with named, distinct callbacks.initialIsVisible = !configuration.isMfaEnabledtoinitialIsVisible = false— or only show the tooltip on explicit user interaction, not on initial render.Workaround used in the meantime
Providing
authenticatedContentand calling the app's own sign-in completion logic from there whenauthStateisAuthState.Success.