Skip to content

feat(auth): make reauthentication a navigation destination - #2471

Open
demolaf wants to merge 1 commit into
feat/auth-navigation-3from
feat/reauth-as-navigation-destination
Open

feat(auth): make reauthentication a navigation destination#2471
demolaf wants to merge 1 commit into
feat/auth-navigation-3from
feat/reauth-as-navigation-destination

Conversation

@demolaf

@demolaf demolaf commented Sep 2, 2026

Copy link
Copy Markdown
Member

Reauthentication was a host-owned ModalBottomSheet containing its own NavDisplay and back stack. It is now a single destination on the main back stack — AuthRoute.Reauth(requestId, userUid, step) — rendered as a sheet by an OverlayScene scene strategy. One stack means one onBack, one place that can pop, and no way for two stacks to disagree about a back press.

ReauthPresentationState and its saver are gone: the marker rides on the key, so rememberNavBackStack persists it. ReauthSheetContent and CustomReauthContent are gone too — all three were internal. ReauthContentState is unchanged.

  • ReauthDestinations.kt / ReauthSceneStrategy.kt: the reauth entry and the sheet/bare presentations, honouring configuration.transitions between steps and hiding the sheet via OverlayScene.onRemove.
  • EmailAuthDestinations.kt: the email step body is now a shared EmailAuthStep, so the reachability guard applies to reauth too — a restored stack holding an unoffered step no longer renders a sign-up form mid-reauthentication.
  • The MFA challenge entry is pushed and popped from one place, keyed on the state being RequiresMfa.

The reauth surface now stays mounted through RetryingOperation and reports it as loading, rather than disappearing and uncovering the flow behind it.

Added tests for the shared reachability guard, the transition between reauth steps, the MFA challenge pop, and the retry behaviour.


Maintainer note: Fixes internal CPRN-403

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the reauthentication flow in FirebaseUI Auth by integrating it directly into the host's back stack as a wrapped destination (AuthRoute.Reauth) and managing its presentation via a custom ReauthSceneStrategy. This replaces the previous separate modal sheet and custom content implementations, which have been removed along with their state savers. Additionally, parallel sync is enabled in gradle.properties. Feedback on these changes suggests using rememberUpdatedState for more idiomatic state tracking in FirebaseAuthScreen and adding a safety check in reauthDestinations to ensure the active reauthentication request ID matches the back stack key before rendering.

Comment thread auth/src/main/java/com/firebase/ui/auth/ui/screens/FirebaseAuthScreen.kt Outdated
Comment thread auth/src/main/java/com/firebase/ui/auth/ui/screens/reauth/ReauthDestinations.kt Outdated
@demolaf
demolaf force-pushed the feat/reauth-as-navigation-destination branch 2 times, most recently from 4da9222 to 9d4ce9c Compare September 2, 2026 10:52
@demolaf
demolaf force-pushed the feat/reauth-as-navigation-destination branch from 9d4ce9c to b21a1d6 Compare September 2, 2026 13:17
@demolaf
demolaf force-pushed the feat/reauth-as-navigation-destination branch from b21a1d6 to 7118ce9 Compare September 2, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant