Skip to content

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

separate MFA methods & update method descriptions

Kang Ming2835f1769feb
diff --git a/spec/common-client-libs-sections.json b/spec/common-client-libs-sections.json
index bb798f689d6..d3b7525192c 100644
--- a/spec/common-client-libs-sections.json
+++ b/spec/common-client-libs-sections.json
@@ -457,6 +457,13 @@
"product": "auth",
"type": "function"
},
+ {
+ "id": "reset-password-for-email",
+ "title": "Send a password reset request",
+ "slug": "auth-resetpasswordforemail",
+ "product": "auth",
+ "type": "function"
+ },
{
"id": "session",
"title": "Retrieve a session",
@@ -577,46 +584,54 @@
"type": "function"
},
{
- "id": "mfa-enroll",
- "title": "Enroll a factor",
- "slug": "auth-mfa-enroll",
- "product": "auth",
- "type": "function"
- },
- {
- "id": "mfa-challenge",
- "title": "Create a challenge",
- "slug": "auth-mfa-challenge",
- "product": "auth",
- "type": "function"
- },
- {
- "id": "mfa-verify",
- "title": "Verify a challenge",
- "slug": "auth-mfa-verify",
- "product": "auth",
- "type": "function"
- },
- {
- "id": "mfa-challenge-and-verify",
- "title": "Create and verify a challenge",
- "slug": "auth-mfa-challengeandverify",
- "product": "auth",
- "type": "function"
- },
- {
- "id": "mfa-unenroll",
- "title": "Unenroll a factor",
- "slug": "auth-mfa-unenroll",
- "product": "auth",
- "type": "function"
- },
- {
- "id": "mfa-get-authenticator-assurance-level",
- "title": "Get Authenticator Assurance Level",
- "slug": "auth-mfa-getauthenticatorassurancelevel",
- "product": "auth",
- "type": "function"
+ "id": "auth-mfa-api",
+ "title": "Auth MFA",
+ "slug": "auth-mfa-api",
+ "type": "function",
+ "items": [
+ {
+ "id": "mfa-enroll",
+ "title": "Enroll a factor",
+ "slug": "auth-mfa-enroll",
+ "product": "auth",
+ "type": "function"
+ },
+ {
+ "id": "mfa-challenge",
+ "title": "Create a challenge",
+ "slug": "auth-mfa-challenge",
+ "product": "auth",
+ "type": "function"
+ },
+ {
+ "id": "mfa-verify",
+ "title": "Verify a challenge",
+ "slug": "auth-mfa-verify",
+ "product": "auth",
+ "type": "function"
+ },
+ {
+ "id": "mfa-challenge-and-verify",
+ "title": "Create and verify a challenge",
+ "slug": "auth-mfa-challengeandverify",
+ "product": "auth",
+ "type": "function"
+ },
+ {
+ "id": "mfa-unenroll",
+ "title": "Unenroll a factor",
+ "slug": "auth-mfa-unenroll",
+ "product": "auth",
+ "type": "function"
+ },
+ {
+ "id": "mfa-get-authenticator-assurance-level",
+ "title": "Get Authenticator Assurance Level",
+ "slug": "auth-mfa-getauthenticatorassurancelevel",
+ "product": "auth",
+ "type": "function"
+ }
+ ]
},
{
"id": "admin-api",
@@ -659,13 +674,6 @@
"product": "auth-admin",
"type": "function"
},
- {
- "id": "reset-password-for-email",
- "title": "Send a password reset request",
- "slug": "auth-admin-resetpasswordforemail",
- "product": "auth-admin",
- "type": "function"
- },
{
"id": "generate-link",
"title": "Generate an email link",
diff --git a/spec/supabase_js_v2.yml b/spec/supabase_js_v2.yml
index 08aaaf6f95d..81d284826f8 100644
--- a/spec/supabase_js_v2.yml
+++ b/spec/supabase_js_v2.yml
@@ -659,7 +659,14 @@ functions:
```js
supabase.auth.exchangeCodeForSession('34e770dd-9ff9-416c-87fa-43b31d7ef225')
```
+ - id: auth-mfa-api
+ title: 'Overview'
+ notes: |
+ This section contains methods commonly used for Multi-Factor Authentication (MFA) and are invoked behind the `supabase.auth.mfa` namespace.
+ Currently, we only support time-based one-time password (TOTP) as the 2nd factor. We don't support recovery codes but we allow users to enroll more than 1 TOTP factor, with an upper limit of 10.
+
+ Having a 2nd TOTP factor for recovery frees the user of the burden of having to store their recovery codes somewhere. It also reduces the attack surface since multiple recovery codes are usually generated compared to just having 1 backup TOTP factor.
- id: mfa-enroll
title: 'mfa.enroll()'
$ref: '@supabase/gotrue-js.GoTrueMFAApi.enroll'
@@ -833,6 +840,8 @@ functions:
$ref: '@supabase/gotrue-js.GoTrueAdminApi.createUser'
notes: |
- To confirm the user's email address or phone number, set `email_confirm` or `phone_confirm` to true. Both arguments default to false.
+ - `createUser()` will not send a confirmation email to the user. You can use [`inviteUserByEmail()`](/docs/reference/javascript/auth-admin-inviteuserbyemail) if you want to send them an email invite instead.
+ - If you are sure that the created user's email or phone number is legitimate and verified, you can set the `email_confirm` or `phone_confirm` param to `true`.
examples:
- id: create-a-new-user-with-custom-user-metadata
name: With custom user metadata
@@ -954,6 +963,10 @@ functions:
- id: generate-link
title: 'generateLink()'
$ref: '@supabase/gotrue-js.GoTrueAdminApi.generateLink'
+ notes: |
+ - The following types can be passed into `generateLink()`: `signup`, `magiclink`, `invite`, `recovery`, `email_change_current`, `email_change_new`, `phone_change`.
+ - `generateLink()` only generates the email link for `email_change_email` if the "Secure email change" setting is enabled under the "Email" provider in your Supabase project.
+ - `generateLink()` handles the creation of the user for `signup`, `invite` and `magiclink`.
examples:
- id: generate-a-signup-link
name: Generate a signup link