Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions packages/auth/lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2096,18 +2096,27 @@ export namespace FirebaseAuthTypes {
/**
* Returns a list of authentication methods that can be used to sign in a given user (identified by its main email address).
*
* ⚠️ Note:
* If "Email Enumeration Protection" is enabled in your Firebase Authentication settings (which is the default),
* this method may return an empty array even if the email is registered, especially when called from an unauthenticated context.
*
* This is a security measure to prevent leaking account existence via email enumeration attacks.
* Do not use the result of this method to directly inform the user whether an email is registered.
*
* #### Example
*
* ```js
* const methods = await firebase.auth().fetchSignInMethodsForEmail('[email protected]');
*
* methods.forEach((method) => {
* console.log(method);
* });
* if (methods.length > 0) {
* // Likely a registered user — offer sign-in
* } else {
* // Could be unregistered OR email enumeration protection is active — offer registration
* }
* ```
*
* @error auth/invalid-email Thrown if the email address is not valid.
* @param email The users email address.
* @param email The user's email address.
*/
fetchSignInMethodsForEmail(email: string): Promise<string[]>;

Expand Down
Loading