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
Copy file name to clipboardExpand all lines: docs-devsite/auth.md
+8-7
Original file line number
Diff line number
Diff line change
@@ -28,15 +28,15 @@ 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
38
|[revokeAccessToken(auth, token)](./auth.md#revokeaccesstoken)| Revokes the given access token. Currently only supports Apple OAuth access tokens. |
39
-
|[sendPasswordResetEmail(auth, email, actionCodeSettings)](./auth.md#sendpasswordresetemail)| Sends a password reset email to the given email address. |
39
+
|[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 there's no user account with the given email address and \[Email Enumeration Protection\](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection) is enabled. |
40
40
|[sendSignInLinkToEmail(auth, email, actionCodeSettings)](./auth.md#sendsigninlinktoemail)| Sends a sign-in email link to the user with the specified email. |
41
41
|[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. |
42
42
|[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.
400
+
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.
401
401
402
402
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.
403
403
@@ -412,7 +412,7 @@ export declare function fetchSignInMethodsForEmail(auth: Auth, email: string): P
412
412
| Parameter | Type | Description |
413
413
| --- | --- | --- |
414
414
| auth |[Auth](./auth.auth.md#auth_interface)| The [Auth](./auth.auth.md#auth_interface) instance. |
415
-
| email | string | The user's email address. |
415
+
| email | string | The user's email address.<!---->Deprecated. Migrating off of this method is recommended as a security best-practice. Learn more in the Identity Platform documentation for \[Email Enumeration Protection\](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection).|
416
416
417
417
<b>Returns:</b>
418
418
@@ -622,7 +622,7 @@ Promise<void>
622
622
623
623
## sendPasswordResetEmail()
624
624
625
-
Sends a password reset email to the given email address.
625
+
Sends a password reset email to the given email address. This method does not throw an error when there's no user account with the given email address and \[Email Enumeration Protection\](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection) is enabled.
626
626
627
627
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.
827
827
828
-
Fails with an error if the email address and password do not match.
828
+
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.
829
829
830
830
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. |
1636
-
| newEmail | string | The new email address. |
1636
+
| 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
+5-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,8 @@ 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.
50
+
* Learn more in the Identity Platform documentation for [Email Enumeration Protection](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection).
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