Skip to content

Commit ac9d40a

Browse files
committed
Update docs
1 parent af73481 commit ac9d40a

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

docs-devsite/auth.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Firebase Authentication
4949
| [signOut(auth)](./auth.md#signout) | Signs out the current user. |
5050
| [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. |
5151
| [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. |
5253
| [verifyPasswordResetCode(auth, code)](./auth.md#verifypasswordresetcode) | Checks a password reset code sent to the user by email or other out-of-band mechanism. |
5354
| <b>function(link...)</b> |
5455
| [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. |
@@ -1080,6 +1081,39 @@ export declare function useDeviceLanguage(auth: Auth): void;
10801081

10811082
void
10821083

1084+
## validatePassword()
1085+
1086+
Validates the password against the password policy configured for the project or tenant.
1087+
1088+
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.
1089+
1090+
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.
1091+
1092+
<b>Signature:</b>
1093+
1094+
```typescript
1095+
export declare function validatePassword(auth: Auth, password: string): Promise<PasswordValidationStatus>;
1096+
```
1097+
1098+
### Parameters
1099+
1100+
| Parameter | Type | Description |
1101+
| --- | --- | --- |
1102+
| auth | [Auth](./auth.auth.md#auth_interface) | The [Auth](./auth.auth.md#auth_interface) instance. |
1103+
| password | string | The password to validate. |
1104+
1105+
<b>Returns:</b>
1106+
1107+
Promise&lt;[PasswordValidationStatus](./auth.passwordvalidationstatus.md#passwordvalidationstatus_interface)<!-- -->&gt;
1108+
1109+
### Example
1110+
1111+
1112+
```javascript
1113+
validatePassword(auth, 'some-password');
1114+
1115+
```
1116+
10831117
## verifyPasswordResetCode()
10841118

10851119
Checks a password reset code sent to the user by email or other out-of-band mechanism.

0 commit comments

Comments
 (0)