Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

add unenroll method

Kang Mingd207e6caff2c
diff --git a/spec/common-client-libs-sections.json b/spec/common-client-libs-sections.json
index 1a913b94b67..c71001c426b 100644
--- a/spec/common-client-libs-sections.json
+++ b/spec/common-client-libs-sections.json
@@ -610,6 +610,14 @@
"type": "function",
"libs": ["js"]
},
+ {
+ "id": "mfa-unenroll",
+ "title": "Unenroll a factor",
+ "slug": "auth-mfa-unenroll",
+ "product": "auth",
+ "type": "function",
+ "libs": ["js"]
+ },
{
"id": "mfa-get-authenticator-assurance-level",
"title": "Get Authenticator Assurance Level",
diff --git a/spec/supabase_js_v2.yml b/spec/supabase_js_v2.yml
index 57c32e618be..324f6186388 100644
--- a/spec/supabase_js_v2.yml
+++ b/spec/supabase_js_v2.yml
@@ -467,7 +467,7 @@ functions:
- id: enroll-totp-factor
name: Enroll a time-based, one-time password (TOTP) factor
isSpotlight: true
- js: |
+ code: |
```js
const { data, error } = await supabase.auth.mfa.enroll({
factorType: 'totp'
@@ -480,7 +480,7 @@ functions:
- id: create-mfa-challenge
name: Create a challenge for a factor
isSpotlight: true
- js: |
+ code: |
```js
const { data, error } = await supabase.auth.mfa.challenge({
factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225'
@@ -493,11 +493,11 @@ functions:
- id: verify-challenge
name: Verify a challenge for a factor
isSpotlight: true
- js: |
+ code: |
```js
const { data, error } = await supabase.auth.mfa.verify({
factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',
- challengeId: '11111111-1111-1111-1111-111111111111',
+ challengeId: '4034ae6f-a8ce-4fb5-8ee5-69a5863a7c15',
code: '123456'
})
```
@@ -510,7 +510,7 @@ functions:
- id: challenge-and-verify
name: Create and verify a challenge for a factor
isSpotlight: true
- js: |
+ code: |
```js
const { data, error } = await supabase.auth.mfa.challengeAndVerify({
factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',
@@ -518,6 +518,19 @@ functions:
code: '123456'
})
```
+ - id: mfa-unenroll
+ title: 'mfa.unenroll()'
+ $ref: '@supabase/gotrue-js.GoTrueMFAApi.unenroll'
+ examples:
+ - id: unenroll-a-factor
+ name: Unenroll a factor
+ isSpotlight: true
+ code: |
+ ```js
+ const { data, error } = await supabase.auth.mfa.unenroll({
+ factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',
+ })
+ ```
- id: mfa-get-authenticator-assurance-level
title: 'mfa.getAuthenticatorAssuranceLevel()'
$ref: '@supabase/gotrue-js.GoTrueMFAApi.getAuthenticatorAssuranceLevel'
@@ -528,7 +541,7 @@ functions:
- id: get-aal
name: Get the AAL details of a session
isSpotlight: true
- js: |
+ code: |
```js
const { data, error } = await supabase.auth.mfa.getAuthenticatorAssuranceLevel()
const { currentLevel, nextLevel, currentAuthenticationMethods } = data
@@ -819,7 +832,7 @@ functions:
- id: list-factors
name: List all factors for a user
isSpotlight: true
- js: |
+ code: |
```js
const { data, error } = await supabase.auth.admin.mfa.listFactors()
```
@@ -830,11 +843,11 @@ functions:
- id: delete-factor
name: Delete a factor for a user
isSpotlight: true
- js: |
+ code: |
```js
const { data, error } = await supabase.auth.admin.mfa.deleteFactor({
- id: '034f5b5e-845a-4759-8b9a-bafc42b009c9',
- userId: '3ebe6175-a808-4f9f-a279-0032caabacf2',
+ id: '34e770dd-9ff9-416c-87fa-43b31d7ef225',
+ userId: 'a89baba7-b1b7-440f-b4bb-91026967f66b',
})
```
- id: select