voluptasmollitia
Version:
Monorepo for the Firebase JavaScript SDK
41 lines (23 loc) • 1.5 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@firebase/auth](./auth.md) > [MultiFactorUser](./auth.multifactoruser.md) > [unenroll](./auth.multifactoruser.unenroll.md)
## MultiFactorUser.unenroll() method
Unenrolls the specified second factor.
<b>Signature:</b>
```typescript
unenroll(option: MultiFactorInfo | string): Promise<void>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| option | [MultiFactorInfo](./auth.multifactorinfo.md) \| string | The multi-factor option to unenroll. |
<b>Returns:</b>
Promise<void>
- A promise which resolves when the unenroll operation is complete.
## Remarks
To specify the factor to remove, pass a [MultiFactorInfo](./auth.multifactorinfo.md) object (retrieved from [MultiFactorUser.enrolledFactors](./auth.multifactoruser.enrolledfactors.md)<!-- -->) or the factor's UID string. Sessions are not revoked when the account is unenrolled. An email notification is likely to be sent to the user notifying them of the change. Recent re-authentication is required for this operation to succeed. When an existing factor is unenrolled, an email notification is sent to the user’s email.
## Example
```javascript
const multiFactorUser = multiFactor(auth.currentUser);
// Present user the option to choose which factor to unenroll.
await multiFactorUser.unenroll(multiFactorUser.enrolledFactors[i])
```