Skip to content

feat(auth): legacyFetchSignInWithEmail config option for users still wishing to use auth.fetchSignInWithEmail()#1330

Open
russellwheatley wants to merge 13 commits intomainfrom
fetchsigninwithemail-feature
Open

feat(auth): legacyFetchSignInWithEmail config option for users still wishing to use auth.fetchSignInWithEmail()#1330
russellwheatley wants to merge 13 commits intomainfrom
fetchsigninwithemail-feature

Conversation

@russellwheatley
Copy link
Copy Markdown
Member

@russellwheatley russellwheatley commented Mar 23, 2026

Description

  • Adds an opt-in legacyFetchSignInWithEmail auth mode that looks up a user’s previous sign-in methods and offers a recovery path when email/password sign-in fails or hits an account conflict.
  • A LegacySignInRecoveryView sheet in the SwiftUI auth flow, with localized copy and buttons for the previously used provider(s), including email/password, email link, phone, and enabled OAuth providers.
  • Prefills the recovered email address when the user is routed back into email/password or email-link sign-in, and suppresses the generic error alert for this handled recovery case.
  • Updates conflict/error handling across auth entry points so account conflicts can route into the legacy recovery flow instead of always surfacing a default error.
  • Adds test coverage for the new recovery flow with unit tests, UI tests, emulator helpers for email-link-only accounts, and test launch flags to preview the recovery sheet.

This is the modal that pops up when the user has set legacyFetchSignInWithEmail to true and they have previously signed in with email/password:

Simulator.Screen.Recording.-.iPhone.17.-.2026-04-22.at.17.18.03.mov

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a legacy sign-in recovery feature to FirebaseUI, allowing users to recover their accounts when they attempt to sign in with an incorrect provider. It adds a new configuration option to enable this feature, modifies error handling to accommodate the new recovery flow, and introduces a new UI component to display the recovery options. Additionally, it includes new tests to ensure the feature functions as expected.

Highlights

  • Legacy Sign-In Recovery: Introduces a new feature to help users recover their accounts when they attempt to sign in with the wrong provider. This is achieved by presenting a recovery modal with a list of available sign-in methods for their email.
  • AuthConfiguration Option: Adds a legacyFetchSignInWithEmail option to AuthConfiguration to enable or disable the legacy sign-in recovery feature.
  • Error Handling: Modifies error handling in various views to accommodate the new legacySignInRecoveryPresented error, preventing the display of error alerts when the recovery modal is presented.
  • UI Enhancements: Adds a new LegacySignInRecoveryView to display the recovery options to the user.
  • Testing: Adds new tests to verify the behavior of the legacy sign-in recovery feature.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist
Copy link
Copy Markdown

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@russellwheatley
Copy link
Copy Markdown
Member Author

/gemini review

Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

Code Review

The pull request introduces a new legacy sign-in recovery feature for Firebase SwiftUI authentication. This includes adding a legacySignInRecoveryPresented error type, new data structures (LegacySignInOption, LegacySignInRecoveryContext), and methods within AuthService to manage and present recovery options. The AuthConfiguration now includes a legacyFetchSignInWithEmail flag to enable this feature. A new LegacySignInRecoveryView is added to display these options, and AuthPickerView is updated to present this view as a sheet. Error handling in various sign-in flows is adjusted to correctly trigger this recovery mechanism. A critical fix ensures that the legacySignInRecoveryPresented error, which is an internal signal, does not trigger a user-facing error alert.

@russellwheatley russellwheatley force-pushed the fetchsigninwithemail-feature branch from bd1e9fd to 179f5ba Compare March 23, 2026 16:22
@russellwheatley russellwheatley changed the title Fetchsigninwithemail feature feat(auth): legacyFetchSignInWithEmail config option for users still wishing to use auth.fetchSignInWithEmail() Mar 23, 2026
@russellwheatley russellwheatley marked this pull request as ready for review April 22, 2026 16:26
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