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
Add a validatePassword method for validating passwords against the password policy configured for the project or a tenant. This method returns a status object that can be used to display the requirements of the password policy and whether each one was met.
Copy file name to clipboardExpand all lines: docs-devsite/auth.md
+36Lines changed: 36 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,7 @@ Firebase Authentication
49
49
|[signOut(auth)](./auth.md#signout)| Signs out the current user. |
50
50
|[updateCurrentUser(auth, user)](./auth.md#updatecurrentuser)| Asynchronously sets the provided user as [Auth.currentUser](./auth.auth.md#authcurrentuser) on the [Auth](./auth.auth.md#auth_interface) instance. |
51
51
|[useDeviceLanguage(auth)](./auth.md#usedevicelanguage)| Sets the current language to the default device/browser preference. |
52
+
|[validatePassword(auth, password)](./auth.md#validatepassword)| Validates the password against the password policy configured for the project or tenant. |
52
53
|[verifyPasswordResetCode(auth, code)](./auth.md#verifypasswordresetcode)| Checks a password reset code sent to the user by email or other out-of-band mechanism. |
53
54
| <b>function(link...)</b> |
54
55
|[parseActionCodeURL(link)](./auth.md#parseactioncodeurl)| Parses the email action link string and returns an [ActionCodeURL](./auth.actioncodeurl.md#actioncodeurl_class) if the link is valid, otherwise returns null. |
@@ -124,6 +125,8 @@ Firebase Authentication
124
125
|[MultiFactorUser](./auth.multifactoruser.md#multifactoruser_interface)| An interface that defines the multi-factor related properties and operations pertaining to a [User](./auth.user.md#user_interface)<!---->. |
125
126
|[OAuthCredentialOptions](./auth.oauthcredentialoptions.md#oauthcredentialoptions_interface)| Defines the options for initializing an [OAuthCredential](./auth.oauthcredential.md#oauthcredential_class)<!---->. |
126
127
|[ParsedToken](./auth.parsedtoken.md#parsedtoken_interface)| Interface representing a parsed ID token. |
128
+
|[PasswordPolicy](./auth.passwordpolicy.md#passwordpolicy_interface)| A structure specifying password policy requirements. |
129
+
|[PasswordValidationStatus](./auth.passwordvalidationstatus.md#passwordvalidationstatus_interface)| A structure indicating which password policy requirements were met or violated and what the requirements are. |
127
130
|[Persistence](./auth.persistence.md#persistence_interface)| An interface covering the possible persistence mechanism types. |
128
131
|[PhoneMultiFactorAssertion](./auth.phonemultifactorassertion.md#phonemultifactorassertion_interface)| The class for asserting ownership of a phone second factor. Provided by [PhoneMultiFactorGenerator.assertion()](./auth.phonemultifactorgenerator.md#phonemultifactorgeneratorassertion)<!---->. |
129
132
|[PhoneMultiFactorEnrollInfoOptions](./auth.phonemultifactorenrollinfooptions.md#phonemultifactorenrollinfooptions_interface)| Options used for enrolling a second factor. |
@@ -1077,6 +1080,39 @@ export declare function useDeviceLanguage(auth: Auth): void;
1077
1080
1078
1081
void
1079
1082
1083
+
## validatePassword()
1084
+
1085
+
Validates the password against the password policy configured for the project or tenant.
1086
+
1087
+
If no tenant ID is set on the `Auth` instance, then this method will use the password policy configured for the project. Otherwise, this method will use the policy configured for the tenant. If a password policy has not been configured, then the default policy configured for all projects will be used.
1088
+
1089
+
If an auth flow fails because a submitted password does not meet the password policy requirements and this method has previously been called, then this method will use the most recent policy available when called again.
0 commit comments