feat(auth)!: make each email sign-in mode a real navigation destination - #2466
Merged
russellwheatley merged 1 commit intoSep 2, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the email authentication flow by splitting the single email destination into individual destinations per authentication mode. This preserves the typed email address across mode switches and Activity recreation, and allows proper back-stack navigation. A review comment suggests an improvement in EmailAuthDestinations.kt to perform the redirect navigation atomically in a single transaction rather than calling popBackStack and navigateToEmailStep sequentially.
demolaf
force-pushed
the
feat/auth-per-step-nav-destinations
branch
from
September 1, 2026 18:23
972d911 to
19e2f70
Compare
demolaf
force-pushed
the
feat/auth-per-step-nav-destinations
branch
from
September 2, 2026 00:52
19e2f70 to
eb1ae89
Compare
demolaf
force-pushed
the
feat/auth-per-step-nav-destinations
branch
from
September 2, 2026 13:21
eb1ae89 to
2535e5a
Compare
russellwheatley
approved these changes
Sep 2, 2026
russellwheatley
left a comment
Member
There was a problem hiding this comment.
LGTM - I'll follow up the remaining recovery tests separately
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.
The multi-step email flow (sign-in, sign-up, reset password, email-link) kept its "which mode" state in local composable state shared across a single destination, so switching modes wiped whatever the user had typed, had no back-stack entry, and never animated. This converts it to one destination per mode, so the typed address survives every switch, system back walks through modes in order, and switches animate with the configured transitions.
AuthRoutegains nested per-step routes for all three auth flows and aroutePattern/routedistinction, soMfaEnrollmentScreenandPhoneAuthScreencan adopt the same per-step navigation later with no further public API change (tracked as follow-up PRs). Error-recovery navigation is now owned solely by the host —EmailAuthScreenno longer navigates itself on error, only reports.EmailAuthDestinations.kt: sharedNavGraphBuilderextension registering the four email destinations, used by bothFirebaseAuthScreenand the reauthentication sheet.EmailAuthScreen: gainedmode/onNavigateToMode(paired — passing one without the other throws at composition) andonEmailTyped;onContinueWithProviderremoved (the host owns provider hand-off now).ReauthPresentationState: route round-trip switched from an order-dependentwhento an explicit route-string-to-id map, since a flow and its start step can now share a route string.Added
EmailAuthRouteNavigationTest,FirebaseAuthScreenEmailRecoveryTest,EmailAuthScreenModeSwitchTest,EmailAuthHostDestinationsTestandReauthPresentationStateSaverTestcovering preservation across switches and Activity recreation, back-stack bounding, error-recovery push/replace, and both hosts registering identical destinations.AuthRoutegained nested per-step routes (6 subclasses → 16). An else-less exhaustivewhen (route)no longer compiles.auth_email→auth_email_signin,auth_phone→auth_phone_number,auth_mfa_enrollment→auth_mfa_enrollment_select_factor.EmailAuthScreen.onContinueWithProviderremoved.Usage
Maintainer note: Fixes internal CPRN-403