Skip to content

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

update auth docs

Kang Ming09ff703a4907
diff --git a/spec/common-client-libs-sections.json b/spec/common-client-libs-sections.json
index d90b37c39bf..bb798f689d6 100644
--- a/spec/common-client-libs-sections.json
+++ b/spec/common-client-libs-sections.json
@@ -541,6 +541,20 @@
"product": "auth",
"type": "function"
},
+ {
+ "id": "send-password-reauthentication",
+ "title": "Send a password reauthentication nonce",
+ "slug": "auth-reauthentication",
+ "product": "auth",
+ "type": "function"
+ },
+ {
+ "id": "resend-email-or-phone-otps",
+ "title": "Resend an OTP",
+ "slug": "auth-resend",
+ "product": "auth",
+ "type": "function"
+ },
{
"id": "set-session",
"title": "Set the session data",
diff --git a/spec/supabase_js_v2.yml b/spec/supabase_js_v2.yml
index 2b06ecc41f8..9a8f0d1a1b5 100644
--- a/spec/supabase_js_v2.yml
+++ b/spec/supabase_js_v2.yml
@@ -465,6 +465,82 @@ functions:
data: { hello: 'world' }
})
```
+ - id: update-password-with-reauthentication
+ name: Update the user's password with a nonce
+ description: If "Secure password change" is enabled, updating the user's password would require a nonce. The nonce is sent to the user's email or phone number.
+ isSpotlight: true
+ code: |
+ ```js
+ const { data, error } = await supabase.auth.updateUser({
+ password: 'new password',
+ nonce: '123456'
+ })
+ ```
+ - id: send-password-reauthentication
+ title: 'reauthenticate()'
+ $ref: '@supabase/gotrue-js.GoTrueClient.reauthenticate'
+ notes: |
+ - This method is used together with `updateUser()` when a user's password needs to be updated.
+ - This method will send a nonce to the user's email. If the user doesn't have a confirmed email address, the method will send the nonce to the user's confirmed phone number instead.
+ examples:
+ - id: send-reauthentication-nonce
+ name: Send reauthentication nonce
+ description: Sends a reauthentication nonce to the user's email or phone number.
+ isSpotlight: true
+ code: |
+ ```js
+ const { data, error } = await supabase.auth.reauthenticate()
+ ```
+ - id: resend-email-or-phone-otps
+ title: 'resend()'
+ $ref: '@supabase/gotrue-js.GoTrueClient.resend'
+ notes: |
+ - Resends a signup confirmation, email change or phone change email to the user.
+ - Passwordless sign-ins can be resent by calling the `signInWithOtp()` method again.
+ - Password recovery emails can be resent by calling the `resetPassswordForEmail()` method again.
+ - This method will only resend an email or phone OTP to the user if there was an initial signup, email change or phone change request being made.
+ examples:
+ - id: resend-email-signup-confirmation
+ name: Resend an email signup confirmation
+ description: Resends the email signup confirmation to the user
+ isSpotlight: true
+ code: |
+ ```js
+ const { data, error } = await supabase.auth.resend({
+ type: 'signup',
+ })
+ ```
+ - id: resend-phone-signup-confirmation
+ name: Resend a phone signup confirmation
+ description: Resends the phone signup confirmation email to the user
+ code: |
+ ```js
+ const { data, error } = await supabase.auth.resend({
+ type: 'sms',
+ phone: '1234567890'
+ })
+ ```
+ - id: resend-email-change-email
+ name: Resend email change email
+ description: Resends the email change email to the user
+ code: |
+ ```js
+ const { data, error } = await supabase.auth.resend({
+ type: 'email_change',
+ })
+ ```
+ - id: resend-phone-change
+ name: Resend phone change OTP
+ description: Resends the phone change OTP to the user
+ code: |
+ ```js
+ const { data, error } = await supabase.auth.resend({
+ type: 'phone_change',
+ phone: '1234567890'
+ })
+ ```
- id: set-session
title: 'setSession()'
$ref: '@supabase/gotrue-js.GoTrueClient.setSession'