diff --git a/apps/reference/_supabase_js/generated/auth-admin-inviteuserbyemail.mdx b/apps/reference/_supabase_js/generated/auth-admin-inviteuserbyemail.mdx
index 04022857529..05b02be5a3f 100644
--- a/apps/reference/_supabase_js/generated/auth-admin-inviteuserbyemail.mdx
+++ b/apps/reference/_supabase_js/generated/auth-admin-inviteuserbyemail.mdx
@@ -10,6 +10,12 @@ import TabItem from '@theme/TabItem'
Sends an invite link to an email address.
+```js
+const { data, error } = await supabase.auth.admin.inviteUserByEmail(
+ 'email@example.com'
+)
+```
+
## Parameters
diff --git a/apps/reference/_supabase_js/generated/auth-admin-updateuserbyid.mdx b/apps/reference/_supabase_js/generated/auth-admin-updateuserbyid.mdx
index 7a6d34d80ae..a55efaa8800 100644
--- a/apps/reference/_supabase_js/generated/auth-admin-updateuserbyid.mdx
+++ b/apps/reference/_supabase_js/generated/auth-admin-updateuserbyid.mdx
@@ -13,7 +13,7 @@ Updates the user data.
```js
const { data: user, error } = await supabase.auth.admin.updateUserById(
'6aa5d0d4-2a9f-4483-b6c8-0cf4c6c98ac4',
- { email: 'new@email.com' }
+ { user_metadata: { hello: 'world' } }
)
```
diff --git a/apps/reference/_supabase_js/generated/auth-signinwithoauth.mdx b/apps/reference/_supabase_js/generated/auth-signinwithoauth.mdx
index 61a4002a9c3..69afe49fd83 100644
--- a/apps/reference/_supabase_js/generated/auth-signinwithoauth.mdx
+++ b/apps/reference/_supabase_js/generated/auth-signinwithoauth.mdx
@@ -10,6 +10,12 @@ import TabItem from '@theme/TabItem'
Log in an existing user via a third-party provider.
+```js
+const { data, error } = await supabase.auth.signInWithOAuth({
+ provider: 'github',
+})
+```
+
## Parameters
diff --git a/apps/reference/_supabase_js/generated/auth-signinwithpassword.mdx b/apps/reference/_supabase_js/generated/auth-signinwithpassword.mdx
index bd7abe414af..58126dfe0b9 100644
--- a/apps/reference/_supabase_js/generated/auth-signinwithpassword.mdx
+++ b/apps/reference/_supabase_js/generated/auth-signinwithpassword.mdx
@@ -10,6 +10,13 @@ import TabItem from '@theme/TabItem'
Log in an existing user, or login via a third-party provider.
+```js
+const { data, error } = await supabase.auth.signInWithPassword({
+ email: 'example@email.com',
+ password: 'example-password',
+})
+```
+
## Parameters
@@ -149,3 +156,33 @@ Verification token received when the user completes the captcha on the site.
## Notes
- Requires either an email and password or a phone number and password.
+
+## Examples
+
+### Sign in with Email.
+
+Sign in with email and password. After a user has verified their email, they can use the [`signInWithPassword()`](/docs/reference/javascript/auth-signin#sign-in-using-phone) method.
+
+```js
+const { data, error } = await supabase.auth.signInWithPassword({
+ email: 'example@email.com',
+ password: 'example-password',
+})
+```
+
+### Sign in with Phone.
+
+Supabase supports Phone Auth. After a user has verified their number, they can use the [`signIn()`](/docs/reference/javascript/auth-signin#sign-in-using-phone) method.
+
+```js
+const { data, error } = await supabase.auth.signInWithPassword({
+ phone: '+13334445555',
+ password: 'some-password',
+})
+
+// After receiving an SMS with One Time Password.
+let { data, error } = await supabase.auth.verifyOtp({
+ phone: '+13334445555',
+ token: '123456',
+})
+```
diff --git a/apps/reference/_supabase_js/generated/auth-updateuser.mdx b/apps/reference/_supabase_js/generated/auth-updateuser.mdx
index 6d684ad1781..6d7030cc734 100644
--- a/apps/reference/_supabase_js/generated/auth-updateuser.mdx
+++ b/apps/reference/_supabase_js/generated/auth-updateuser.mdx
@@ -11,8 +11,8 @@ import TabItem from '@theme/TabItem'
Updates user data, if there is a logged in user.
```js
-const { data, error } = await supabase.auth.updateUser({
- email: 'new@email.com',
+const { user, error } = await supabase.auth.updateUser({
+ data: { hello: 'world' },
})
```
diff --git a/apps/reference/_supabase_js/generated/auth-verifyotp.mdx b/apps/reference/_supabase_js/generated/auth-verifyotp.mdx
new file mode 100644
index 00000000000..15ae3e74916
--- /dev/null
+++ b/apps/reference/_supabase_js/generated/auth-verifyotp.mdx
@@ -0,0 +1,136 @@
+---
+id: auth-verifyotp
+title: 'verifyOtp()'
+slug: /auth-verifyotp
+custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v2_legacy.yml
+---
+
+import Tabs from '@theme/Tabs'
+import TabItem from '@theme/TabItem'
+
+Log in a user given a User supplied OTP received via mobile.
+
+```js
+const { data, error } = await supabase.auth.verifyOtp({
+ phone,
+ token,
+ type: 'sms',
+})
+```
+
+## Parameters
+
+
+
+## Examples
+
+### Verify Sms One-Time Password (OTP)
+
+```js
+const { data, error } = await supabase.auth.verifyOtp({
+ phone,
+ token,
+ type: 'sms',
+})
+```
+
+### Verify Signup One-Time Password (OTP)
+
+```js
+const { data, error } = await supabase.auth.verifyOtp({
+ email,
+ token,
+ type: 'signup',
+})
+```
diff --git a/apps/reference/nav/supabase_js_sidebars.js b/apps/reference/nav/supabase_js_sidebars.js
index 14e4cbfcaad..542c673ad7f 100644
--- a/apps/reference/nav/supabase_js_sidebars.js
+++ b/apps/reference/nav/supabase_js_sidebars.js
@@ -38,12 +38,12 @@ const sidebars = {
'generated/auth-signinwithotp',
'generated/auth-signinwithoauth',
'generated/auth-signout',
+ 'generated/auth-verifyotp',
'generated/auth-getsession',
'generated/auth-getuser',
'generated/auth-updateuser',
'generated/auth-setsession',
'generated/auth-onauthstatechange',
- 'generated/auth-getuser',
'generated/auth-resetpasswordforemail',
],
collapsed: true,
diff --git a/apps/www/next.config.js b/apps/www/next.config.js
index 36703af7ae8..42a4979be14 100644
--- a/apps/www/next.config.js
+++ b/apps/www/next.config.js
@@ -372,6 +372,11 @@ module.exports = withMDX({
source: '/docs/client/auth-signout',
destination: '/docs/reference/javascript/auth-signout',
},
+ {
+ permanent: false,
+ source: '/docs/client/auth-verifyotp',
+ destination: '/docs/reference/javascript/auth-verifyotp',
+ },
{
permanent: false,
source: '/docs/client/auth-session',
@@ -1431,6 +1436,11 @@ module.exports = withMDX({
// },
// {
// permanent: true,
+ // source: '/docs/reference/javascript/auth-api-verifyotp',
+ // destination: '/docs/reference/javascript/auth-verifyotp',
+ // },
+ // {
+ // permanent: true,
// source: '/docs/reference/javascript/auth-api-listusers',
// destination: '/docs/reference/javascript/auth-admin-listusers',
// },
diff --git a/spec/supabase_js_v2_legacy.yml b/spec/supabase_js_v2_legacy.yml
index e6208bcb81a..db56e065b33 100644
--- a/spec/supabase_js_v2_legacy.yml
+++ b/spec/supabase_js_v2_legacy.yml
@@ -39,7 +39,7 @@ pages:
})
```
- name: Sign up with additional user meta data.
- isSpotlight: true
+ isSpotlight: false
js: |
```js
const { data, error } = await supabase.auth.signUp(
@@ -60,8 +60,9 @@ pages:
$ref: '@supabase/gotrue-js.GoTrueClient.signInWithPassword'
notes: |
- Requires either an email and password or a phone number and password.
- example:
+ examples:
- name: Sign in with Email.
+ isSpotlight: true
description: |
Sign in with email and password. After a user has verified their email, they can use the [`signInWithPassword()`](/docs/reference/javascript/auth-signin#sign-in-using-phone) method.
js: |
@@ -72,6 +73,7 @@ pages:
})
```
- name: Sign in with Phone.
+ isSpotlight: false
description: |
Supabase supports Phone Auth. After a user has verified their number, they can use the [`signIn()`](/docs/reference/javascript/auth-signin#sign-in-using-phone) method.
js: |
@@ -107,7 +109,7 @@ pages:
})
```
- name: Sign in with sms otp.
- isSpotlight: true
+ isSpotlight: false
description: The user will be sent an otp to their phone number. By default, a given user can only request an otp once every 60 seconds.
js: |
```js
@@ -123,6 +125,7 @@ pages:
- Supabase supports many different [third-party providers](https://supabase.com/docs/guides/auth#providers).
examples:
- name: Sign in using a third-party provider.
+ isSpotlight: true
js: |
```js
const { data, error } = await supabase.auth.signInWithOAuth({
@@ -130,6 +133,7 @@ pages:
})
```
- name: Sign in using a third-party provider with redirect.
+ isSpotlight: false
description: |
The `redirectTo` param will only applied on the callback made from the third-party provider. It does not redirect the user immediately after invoking this method.
In order for the `redirectTo` param to be allowed, one needs to include it in an allowlist. Supabase supports this for
@@ -144,6 +148,7 @@ pages:
}
```
- name: Sign in with scopes.
+ isSpotlight: false
description: |
If you need additional data from an OAuth provider, you can include a space-separated list of scopes in your request to get back an OAuth provider token.
You may also need to specify the scopes in the provider's OAuth app settings, depending on the provider.
@@ -167,6 +172,22 @@ pages:
```js
const { error } = await supabase.auth.signOut()
```
+ auth.verifyOtp():
+ title: 'verifyOtp()'
+ $ref: '@supabase/gotrue-js.GoTrueClient.verifyOtp'
+ examples:
+ - name: Verify Sms One-Time Password (OTP)
+ isSpotlight: true
+ js: |
+ ```js
+ const { data, error } = await supabase.auth.verifyOtp({ phone, token, type: 'sms'})
+ ```
+ - name: Verify Signup One-Time Password (OTP)
+ isSpotlight: false
+ js: |
+ ```js
+ const { data, error } = await supabase.auth.verifyOtp({ email, token, type: 'signup'})
+ ```
auth.getSession():
title: 'getSession()'
$ref: '@supabase/gotrue-js.GoTrueClient.getSession'
@@ -191,7 +212,7 @@ pages:
const user = supabase.auth.getUser()
```
- name: Get the logged in user with a custom access token jwt.
- isSpotlight: true
+ isSpotlight: false
js: |
```js
const user = supabase.auth.getUser(jwt)
@@ -209,13 +230,13 @@ pages:
examples:
- name: Update email for authenticated user.
description: Sends a "Confirm Email Change" email to the new email address.
- isSpotlight: true
+ isSpotlight: false
js: |
```js
const { data, error } = await supabase.auth.updateUser({email: 'new@email.com'})
```
- name: Update password for authenticated user.
- isSpotlight: true
+ isSpotlight: false
js: |
```js
const { data, error } = await supabase.auth.updateUser({password: 'new password'})
@@ -341,7 +362,6 @@ pages:
})
```
- name: Auto-confirm email.
- isSpotlight: true
js: |
```js
const { data, error } = await supabase.auth.admin.createUser({
@@ -350,7 +370,6 @@ pages:
})
```
- name: Auto-confirm phone.
- isSpotlight: true
js: |
```js
const { data, error } = await supabase.auth.admin.createUser({
@@ -382,7 +401,7 @@ pages:
- This function should only be called on a server. Never expose your `service_role` key in the browser.
examples:
- name: Basic example.
- isSpotlight: false
+ isSpotlight: true
js: |
```js
const { data, error } = await supabase.auth.admin.inviteUserByEmail('email@example.com')
@@ -435,7 +454,7 @@ pages:
)
```
- name: Generate an invite link.
- isSpotlight: true
+ isSpotlight: false
js: |
```js
const { data, error } = await supabase.auth.admin.generateLink(
@@ -452,7 +471,7 @@ pages:
- This function should only be called on a server. Never expose your `service_role` key in the browser.
examples:
- name: Updates a user's email.
- isSpotlight: true
+ isSpotlight: false
js: |
```js
const { data: user, error } = await supabase.auth.admin.updateUserById(
@@ -461,7 +480,7 @@ pages:
)
```
- name: Updates a user's password.
- isSpotlight: true
+ isSpotlight: false
js: |
```js
const { data: user, error } = await supabase.auth.admin.updateUserById(
@@ -479,7 +498,7 @@ pages:
)
```
- name: Updates a user's app_metadata.
- isSpotlight: true
+ isSpotlight: false
js: |
```js
const { data: user, error } = await supabase.auth.admin.updateUserById(
@@ -488,7 +507,7 @@ pages:
)
```
- name: Confirms a user's email address.
- isSpotlight: true
+ isSpotlight: false
js: |
```js
const { data: user, error } = await supabase.auth.admin.updateUserById(
@@ -497,7 +516,7 @@ pages:
)
```
- name: Confirms a user's phone number.
- isSpotlight: true
+ isSpotlight: false
js: |
```js
const { data: user, error } = await supabase.auth.admin.updateUserById(