You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expose INVALID_LOGIN_CREDENTIALS as auth/invalid-credential error.
Update the doc snippets for various SDK methods to explain the behavior when Email Enumeration Protection is enabled.
Mark fetchSignInMethodsForEmail and updateEmail as deprecated.
Update the demo app to use the error code.
Fix error message for the error code and update tests.
Copy file name to clipboardExpand all lines: docs-devsite/auth.md
+8-7
Original file line number
Diff line number
Diff line change
@@ -28,14 +28,14 @@ Firebase Authentication
28
28
|[confirmPasswordReset(auth, oobCode, newPassword)](./auth.md#confirmpasswordreset)| Completes the password reset process, given a confirmation code and new password. |
29
29
|[connectAuthEmulator(auth, url, options)](./auth.md#connectauthemulator)| Changes the [Auth](./auth.auth.md#auth_interface) instance to communicate with the Firebase Auth Emulator, instead of production Firebase Auth services. |
30
30
|[createUserWithEmailAndPassword(auth, email, password)](./auth.md#createuserwithemailandpassword)| Creates a new user account associated with the specified email address and password. |
31
-
|[fetchSignInMethodsForEmail(auth, email)](./auth.md#fetchsigninmethodsforemail)| Gets the list of possible sign in methods for the given email address. |
31
+
|[fetchSignInMethodsForEmail(auth, email)](./auth.md#fetchsigninmethodsforemail)| Gets the list of possible sign in methods for the given email address. This method returns an empty list when \[Email Enumeration Protection\](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection) is enabled, irrespective of the number of authentication methods available for the given email. |
32
32
|[getMultiFactorResolver(auth, error)](./auth.md#getmultifactorresolver)| Provides a [MultiFactorResolver](./auth.multifactorresolver.md#multifactorresolver_interface) suitable for completion of a multi-factor flow. |
33
33
|[getRedirectResult(auth, resolver)](./auth.md#getredirectresult)| Returns a [UserCredential](./auth.usercredential.md#usercredential_interface) from the redirect-based sign-in flow. |
34
34
|[initializeRecaptchaConfig(auth)](./auth.md#initializerecaptchaconfig)| Loads the reCAPTCHA configuration into the <code>Auth</code> instance. |
35
35
|[isSignInWithEmailLink(auth, emailLink)](./auth.md#issigninwithemaillink)| Checks if an incoming link is a sign-in with email link suitable for [signInWithEmailLink()](./auth.md#signinwithemaillink)<!---->. |
36
36
|[onAuthStateChanged(auth, nextOrObserver, error, completed)](./auth.md#onauthstatechanged)| Adds an observer for changes to the user's sign-in state. |
37
37
|[onIdTokenChanged(auth, nextOrObserver, error, completed)](./auth.md#onidtokenchanged)| Adds an observer for changes to the signed-in user's ID token. |
38
-
|[sendPasswordResetEmail(auth, email, actionCodeSettings)](./auth.md#sendpasswordresetemail)| Sends a password reset email to the given email address. |
38
+
|[sendPasswordResetEmail(auth, email, actionCodeSettings)](./auth.md#sendpasswordresetemail)| Sends a password reset email to the given email address. This method does not throw an error when \[Email Enumeration Protection\](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection) is enabled. |
39
39
|[sendSignInLinkToEmail(auth, email, actionCodeSettings)](./auth.md#sendsigninlinktoemail)| Sends a sign-in email link to the user with the specified email. |
40
40
|[setPersistence(auth, persistence)](./auth.md#setpersistence)| Changes the type of persistence on the [Auth](./auth.auth.md#auth_interface) instance for the currently saved <code>Auth</code> session and applies this type of persistence for future sign-in requests, including sign-in with redirect requests. |
41
41
|[signInAnonymously(auth)](./auth.md#signinanonymously)| Asynchronously signs in as an anonymous user. |
Gets the list of possible sign in methods for the given email address.
399
+
Gets the list of possible sign in methods for the given email address. This method returns an empty list when \[Email Enumeration Protection\](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection) is enabled, irrespective of the number of authentication methods available for the given email.
400
400
401
401
This is useful to differentiate methods of sign-in for the same provider, eg. [EmailAuthProvider](./auth.emailauthprovider.md#emailauthprovider_class) which has 2 methods of sign-in, [SignInMethod](./auth.md#signinmethod)<!---->.EMAIL\_PASSWORD and [SignInMethod](./auth.md#signinmethod)<!---->.EMAIL\_LINK.
402
402
@@ -411,7 +411,7 @@ export declare function fetchSignInMethodsForEmail(auth: Auth, email: string): P
411
411
| Parameter | Type | Description |
412
412
| --- | --- | --- |
413
413
| auth |[Auth](./auth.auth.md#auth_interface)| The [Auth](./auth.auth.md#auth_interface) instance. |
414
-
| email | string | The user's email address. |
414
+
| email | string | The user's email address.<!---->Deprecated Migrating off of this method is recommended as a security best-practice.|
Sends a password reset email to the given email address.
603
+
Sends a password reset email to the given email address. This method does not throw an error when \[Email Enumeration Protection\](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection) is enabled.
604
604
605
605
To complete the password reset, call [confirmPasswordReset()](./auth.md#confirmpasswordreset) with the code supplied in the email sent to the user, along with the new password specified by the user.
Asynchronously signs in using an email and password.
805
805
806
-
Fails with an error if the email address and password do not match.
806
+
Fails with an error if the email address and password do not match. When \[Email Enumeration Protection\](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection) is enabled, this method fails with "auth/invalid-credential" in case of an invalid email/password.
807
807
808
808
Note: The user's password is NOT the password used to access the user's email account. The email address serves as a unique identifier for the user, and the password is used to access the user's account in your Firebase project. See also: [createUserWithEmailAndPassword()](./auth.md#createuserwithemailandpassword)<!---->.
| user |[User](./auth.user.md#user_interface)| The user. |
1614
-
| newEmail | string | The new email address. |
1614
+
| newEmail | string | The new email address.<!---->Throws "auth/operation-not-allowed" error when \[Email Enumeration Protection\](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection) is enabled. Deprecated - Use [verifyBeforeUpdateEmail()](./auth.md#verifybeforeupdateemail) instead.|
Copy file name to clipboardExpand all lines: packages/auth/src/core/strategies/email.ts
+4-1
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,9 @@ import { _setActionCodeSettingsOnRequest } from './action_code_settings';
33
33
import{getModularInstance}from'@firebase/util';
34
34
35
35
/**
36
-
* Gets the list of possible sign in methods for the given email address.
36
+
* Gets the list of possible sign in methods for the given email address. This method returns an
37
+
* empty list when [Email Enumeration Protection](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection) is enabled, irrespective of the number of
38
+
* authentication methods available for the given email.
37
39
*
38
40
* @remarks
39
41
* This is useful to differentiate methods of sign-in for the same provider, eg.
@@ -44,6 +46,7 @@ import { getModularInstance } from '@firebase/util';
44
46
* @param auth - The {@link Auth} instance.
45
47
* @param email - The user's email address.
46
48
*
49
+
* Deprecated Migrating off of this method is recommended as a security best-practice.
Copy file name to clipboardExpand all lines: packages/auth/src/core/user/account_info.ts
+3
Original file line number
Diff line number
Diff line change
@@ -88,6 +88,9 @@ export async function updateProfile(
88
88
* @param user - The user.
89
89
* @param newEmail - The new email address.
90
90
*
91
+
* Throws "auth/operation-not-allowed" error when [Email Enumeration Protection](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection) is enabled.
92
+
* Deprecated - Use {@link verifyBeforeUpdateEmail} instead.
0 commit comments