fix(auth): pre-fill email when "Continue as" button is tapped (#2423) - #2425
fix(auth): pre-fill email when "Continue as" button is tapped (#2423)#2425just1and0 wants to merge 5 commits into
Conversation
The "Continue as..." button displayed the saved identifier but discarded it on click, sending the user to a blank email form. Add an onContinueAsSelected callback to AuthMethodPicker that carries the identifier through to EmailAuthScreen, which now initializes the email field with the saved address.
There was a problem hiding this comment.
Code Review
This pull request introduces the ability to pre-fill the email address on the email authentication screen when a user selects the "Continue as..." option from the method picker. This is achieved by passing the saved identifier from AuthMethodPicker via a new onContinueAsSelected callback, storing it in a prefillEmail state in FirebaseAuthScreen, and passing it to EmailAuthScreen to initialize the email input field. Feedback on the changes highlights a potential issue where a non-email identifier (like a phone number) could incorrectly pre-fill the email field if the last used provider was not Email. A code suggestion is provided to only set prefillEmail when the provider is AuthProvider.Email.
demolaf
left a comment
There was a problem hiding this comment.
LGTM, just a couple of changes.
- Update kDoc to say "email address" instead of "phone number" since phone pre-fill is not wired up in this PR - Add SignInUITest with assertions for email pre-fill behavior
Summary
AuthMethodPickerdisplayed the saved email/identifier but discarded it on click — the user landed on a blank email form identical to tapping the regular provider button.onContinueAsSelectedcallback toAuthMethodPickerthat carries the saved identifier through toEmailAuthScreen, which now pre-fills the email field with the saved address.Fixes #2423
My.Movie.2.mp4
Test plan
customLayoutstill work (they don't receiveonContinueAsSelected)