Skip to content

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

Update tabs for auth guides

Joshen Lim3d528c45b367
diff --git a/apps/temp-docs/components/Navigation/Navigation.constants.ts b/apps/temp-docs/components/Navigation/Navigation.constants.ts
index ec3873a7cc6..3877e82b227 100644
--- a/apps/temp-docs/components/Navigation/Navigation.constants.ts
+++ b/apps/temp-docs/components/Navigation/Navigation.constants.ts
@@ -99,9 +99,13 @@ export const menuItems: NavMenu = {
{ name: 'Login with Twitch', url: '/guides/auth/auth-twitch', items: [] },
{ name: 'Login with Twitter', url: '/guides/auth/auth-twitter', items: [] },
{ name: 'Login with WorkOS', url: '/guides/auth/auth-workos', items: [] },
- { name: 'Phone Auth with Twilio', url: '/guides/auth/twilio', items: [] },
- { name: 'Phone Auth with Vonage', url: '/guides/auth/vonage', items: [] },
- { name: 'Phone Auth with MessageBird', url: '/guides/auth/messagebird', items: [] },
+ { name: 'Phone Auth with Twilio', url: '/guides/auth/auth-twilio', items: [] },
+ { name: 'Phone Auth with Vonage', url: '/guides/auth/auth-vonage', items: [] },
+ {
+ name: 'Phone Auth with MessageBird',
+ url: '/guides/auth/auth-messagebird',
+ items: [],
+ },
],
},
{
diff --git a/apps/temp-docs/docs/guides/auth/auth-email.mdx b/apps/temp-docs/docs/guides/auth/auth-email.mdx
index c4c24a828a6..d83cfb328be 100644
--- a/apps/temp-docs/docs/guides/auth/auth-email.mdx
+++ b/apps/temp-docs/docs/guides/auth/auth-email.mdx
@@ -30,12 +30,12 @@ See the [self-hosting docs](/docs/guides/hosting/overview#configuration) for det
## Add login code to your client app
<Tabs
- defaultValue="js"
- groupId="guides/auth"
- values={[{ label: 'JavaScript', value: 'js' }, { label: 'Dart', value: 'dart' }]}
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="js"
>
-
-<TabItem value="js">
+<TabPanel id="js" label="JavaScript">
When your user signs in, call [signInWithPassword()](/docs/reference/javascript/auth-signinwithpassword) with their email address and password:
@@ -48,9 +48,8 @@ async function signInWithEmail() {
}
```
-</TabItem>
-
-<TabItem value="dart">
+</TabPanel>
+<TabPanel id="dart" label="Dart">
When your user signs in, call [signInWithPassword()](/docs/reference/dart/auth-signinwithpassword) with their email address and password:
@@ -63,17 +62,16 @@ Future<void> signInWithEmail() async {
}
```
-</TabItem>
-
+</TabPanel>
</Tabs>
<Tabs
- defaultValue="js"
- groupId="guides/auth"
- values={[{ label: 'JavaScript', value: 'js' }, { label: 'Dart', value: 'dart' }]}
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="js"
>
-
-<TabItem value="js">
+<TabPanel id="js" label="JavaScript">
When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
@@ -83,9 +81,8 @@ async function signOut() {
}
```
-</TabItem>
-
-<TabItem value="dart">
+</TabPanel>
+<TabPanel id="dart" label="Dart">
When your user signs out, call [signOut()](/docs/reference/dart/auth-signout) to remove them from the browser session and any objects from localStorage:
@@ -95,8 +92,7 @@ Future<void> signOut() async {
}
```
-</TabItem>
-
+</TabPanel>
</Tabs>
## Resources
diff --git a/apps/temp-docs/docs/guides/auth/auth-magic-link.mdx b/apps/temp-docs/docs/guides/auth/auth-magic-link.mdx
index 3d09f2e726b..0cf2258a843 100644
--- a/apps/temp-docs/docs/guides/auth/auth-magic-link.mdx
+++ b/apps/temp-docs/docs/guides/auth/auth-magic-link.mdx
@@ -26,12 +26,12 @@ Setting up Magic Link logins for your Supabase application.
## Add login code to your client app
<Tabs
- defaultValue="js"
- groupId="guides/auth"
- values={[{ label: 'JavaScript', value: 'js' }, { label: 'Dart', value: 'dart' }]}
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="js"
>
-
-<TabItem value="js">
+<TabPanel id="js" label="JavaScript">
When your user signs in, call [signInWithOtp()](/docs/reference/javascript/auth-signinwithotp) with their email address:
@@ -43,9 +43,8 @@ async function signInWithEmail() {
}
```
-</TabItem>
-
-<TabItem value="dart">
+</TabPanel>
+<TabPanel id="dart" label="Dart">
When your user signs in, call [signIn()](/docs/reference/dart/auth-signinwithotp) with their email address:
@@ -55,17 +54,16 @@ Future<void> signInWithEmail() async {
}
```
-</TabItem>
-
+</TabPanel>
</Tabs>
<Tabs
- defaultValue="js"
- groupId="guides/auth"
- values={[{ label: 'JavaScript', value: 'js' }, { label: 'Dart', value: 'dart' }]}
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="js"
>
-
-<TabItem value="js">
+<TabPanel id="js" label="JavaScript">
When your user signs out, call [signOut()](/docs/reference/javascript/auth-signout) to remove them from the browser session and any objects from localStorage:
@@ -75,9 +73,8 @@ async function signOut() {
}
```
-</TabItem>
-
-<TabItem value="dart">
+</TabPanel>
+<TabPanel id="dart" label="Dart">
When your user signs out, call [signOut()](/docs/reference/dart/auth-signout) to remove them from the browser session and any objects from localStorage:
@@ -87,8 +84,7 @@ Future<void> signOut() async {
}
```
-</TabItem>
-
+</TabPanel>
</Tabs>
## Resources
diff --git a/apps/temp-docs/docs/guides/auth/auth-messagebird.mdx b/apps/temp-docs/docs/guides/auth/auth-messagebird.mdx
index 9c7c2bb2756..f545769ca13 100644
--- a/apps/temp-docs/docs/guides/auth/auth-messagebird.mdx
+++ b/apps/temp-docs/docs/guides/auth/auth-messagebird.mdx
@@ -36,14 +36,14 @@ Start by logging into your MessageBird account and verify the mobile number you'
This is the number that will be receiving the SMS OTPs.
-![Verify your own phone number](/img/guides/auth-messagebird/1.png)
+![Verify your own phone number](/docs/img/guides/auth-messagebird/1.png)
-![Get your API Keys](/img/guides/auth-messagebird/2.png)
+![Get your API Keys](/docs/img/guides/auth-messagebird/2.png)
Navigate to the [dashboard settings](https://dashboard.messagebird.com/en/settings/sms) to set the default originator. The messagebird originator is the name or number from which the message is sent.
For more information, you can refer to the messagebird article on choosing an originator [here](https://support.messagebird.com/hc/en-us/articles/115002628665-Choosing-an-originator)
-![Set the default originator](/img/guides/auth-messagebird/3.png)
+![Set the default originator](/docs/img/guides/auth-messagebird/3.png)
You will need the following values to get started:
@@ -54,7 +54,7 @@ Now go to the Auth > Settings page in the Supabase dashboard (https://app.supaba
You should see an option to enable Phone Signup.
-![Enable Phone Sign-Up](/img/guides/auth-twilio/7.png)
+![Enable Phone Sign-Up](/docs/img/guides/auth-twilio/7.png)
Toggle it on, and copy the 2 values over from the messagebird dashboard. Click save.
@@ -82,12 +82,12 @@ In this use scenario we'll be using the user's mobile phone number as an alterna
Using supabase-js on the client you'll want to use the same `signUp` method that you'd use for email based sign ups, but with the `phone` param instead of the `email param`:
<Tabs
-defaultValue="JS"
-values={[
- {label: 'JavaScript', value: 'JS'},
- {label: 'HTTP', value: 'HTTP'},
-]}>
-<TabItem value="JS">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="js"
+>
+<TabPanel id="js" label="JavaScript">
```js
let { user, error } = await supabase.auth.signUp({
@@ -96,8 +96,8 @@ let { user, error } = await supabase.auth.signUp({
})
```
-</TabItem>
-<TabItem value="HTTP">
+</TabPanel>
+<TabPanel id="http" label="HTTP">
```bash
curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/signup' \
@@ -109,7 +109,7 @@ curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/signup' \
}'
```
-</TabItem>
+</TabPanel>
</Tabs>
The user will now receive an SMS with a 6-digit pin that you will need to receive from them within 60-seconds before they can login to their account.
@@ -117,12 +117,12 @@ The user will now receive an SMS with a 6-digit pin that you will need to receiv
You should present a form to the user so they can input the 6 digit pin, then send it along with the phone number to `verifyOTP`:
<Tabs
-defaultValue="JS"
-values={[
- {label: 'JavaScript', value: 'JS'},
- {label: 'HTTP', value: 'HTTP'},
-]}>
-<TabItem value="JS">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="js"
+>
+<TabPanel id="js" label="JavaScript">
```js
let { session, error } = await supabase.auth.verifyOTP({
@@ -131,8 +131,8 @@ let { session, error } = await supabase.auth.verifyOTP({
})
```
-</TabItem>
-<TabItem value="HTTP">
+</TabPanel>
+<TabPanel id="http" label="HTTP">
```bash
curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/verify' \
@@ -145,7 +145,7 @@ curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/verify' \
}'
```
-</TabItem>
+</TabPanel>
</Tabs>
If successful the user will now be logged in and you should receive a valid session like:
@@ -164,12 +164,12 @@ The access token can be sent in the Authorization header as a Bearer token for a
Also now that the mobile has been verified, the user can use the number and password to sign in without needing to verify their number each time:
<Tabs
-defaultValue="JS"
-values={[
- {label: 'JavaScript', value: 'JS'},
- {label: 'HTTP', value: 'HTTP'},
-]}>
-<TabItem value="JS">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="js"
+>
+<TabPanel id="js" label="JavaScript">
```js
let { user, error } = await supabase.auth.signInWithPassword({
@@ -178,8 +178,8 @@ let { user, error } = await supabase.auth.signInWithPassword({
})
```
-</TabItem>
-<TabItem value="HTTP">
+</TabPanel>
+<TabPanel id="http" label="HTTP">
```bash
curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/token?grant_type=password' \
@@ -191,7 +191,7 @@ curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/token?grant_type=
}'
```
-</TabItem>
+</TabPanel>
</Tabs>
### Using OTP as a passwordless sign-in mechanism
@@ -201,12 +201,12 @@ In this scenario you are granting your user's the ability to login to their acco
In javascript we can use the `signIn` method with a single parameter: `phone`
<Tabs
-defaultValue="JS"
-values={[
- {label: 'JavaScript', value: 'JS'},
- {label: 'HTTP', value: 'HTTP'},
-]}>
-<TabItem value="JS">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="js"
+>
+<TabPanel id="js" label="JavaScript">
```js
let { user, error } = await supabase.auth.signInWithOtp({
@@ -214,8 +214,8 @@ let { user, error } = await supabase.auth.signInWithOtp({
})
```
-</TabItem>
-<TabItem value="HTTP">
+</TabPanel>
+<TabPanel id="http" label="HTTP">
```bash
curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/otp' \
@@ -226,18 +226,18 @@ curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/otp' \
}'
```
-</TabItem>
+</TabPanel>
</Tabs>
The second step is the same as the previous section, you need to collect the 6-digit pin from the user and pass it along with their phone number to the verify method:
<Tabs
-defaultValue="JS"
-values={[
- {label: 'JavaScript', value: 'JS'},
- {label: 'HTTP', value: 'HTTP'},
-]}>
-<TabItem value="JS">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="js"
+>
+<TabPanel id="js" label="JavaScript">
```js
let { session, error } = await supabase.auth.verifyOTP({
@@ -246,8 +246,8 @@ let { session, error } = await supabase.auth.verifyOTP({
})
```
-</TabItem>
-<TabItem value="HTTP">
+</TabPanel>
+<TabPanel id="http" label="HTTP">
```bash
curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/verify' \
@@ -260,7 +260,7 @@ curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/verify' \
}'
```
-</TabItem>
+</TabPanel>
</Tabs>
and the response should also be the same as above:
diff --git a/apps/temp-docs/docs/guides/auth/auth-twilio.mdx b/apps/temp-docs/docs/guides/auth/auth-twilio.mdx
index f5c0e53cb0a..429582dd9ea 100644
--- a/apps/temp-docs/docs/guides/auth/auth-twilio.mdx
+++ b/apps/temp-docs/docs/guides/auth/auth-twilio.mdx
@@ -47,18 +47,18 @@ Start by logging into your Twilio account and starting a new project: https://ww
Give your project a name and verify the mobile number you'll be using to test with. This is the number that will be receiving the SMS OTPs.
-![Name your twilio project](/img/guides/auth-twilio/1.png)
-![verify your own phone number](/img/guides/auth-twilio/2.png)
+![Name your twilio project](/docs/img/guides/auth-twilio/1.png)
+![verify your own phone number](/docs/img/guides/auth-twilio/2.png)
Select 'SMS', 'Identity & Verification', and 'With code' as options on the welcome form.
-![Form Fields](/img/guides/auth-twilio/3.png)
+![Form Fields](/docs/img/guides/auth-twilio/3.png)
When you're back on the [Twilio console screen](https://www.twilio.com/console), you need to scroll down and click 'Get a trial phone number' - this is the number that you'll be sending SMSs from.
-![Get a trial phone number](/img/guides/auth-twilio/4.png)
+![Get a trial phone number](/docs/img/guides/auth-twilio/4.png)
-![Successful phone number](/img/guides/auth-twilio/5.png)
+![Successful phone number](/docs/img/guides/auth-twilio/5.png)
You should now be able to see all three values you'll need to get started:
@@ -66,19 +66,19 @@ You should now be able to see all three values you'll need to get started:
- Auth Token
- Sender Phone Number
-![All the credentials you'll need](/img/guides/auth-twilio/6.png)
+![All the credentials you'll need](/docs/img/guides/auth-twilio/6.png)
Now go to the Auth > Settings page in the Supabase dashboard (https://app.supabase.com/project/YOUR-PROJECT-REF/auth/settings).
You should see an option to enable Phone Signup:
-![Enable Phone Sign-Up](/img/guides/auth-twilio/7.png)
+![Enable Phone Sign-Up](/docs/img/guides/auth-twilio/7.png)
Toggle it on, and copy the 3 values over from the twilio dashboard. Click save.
Note: for "Twilio Message Service SID" you can use the Sender Phone Number generated above.
-![Plug in Twilio credentials](/img/guides/auth-twilio/8.png)
+![Plug in Twilio credentials](/docs/img/guides/auth-twilio/8.png)
Now the backend should be setup, we can proceed to add our client-side code!
@@ -90,7 +90,7 @@ Go to Auth > Templates page in the Supabase dashboard (https://app.supabase.com/
Use the variable `.Code` in the template to display the OTP code. Here's an example in the SMS template.
-![example in the SMS template](/img/guides/auth-twilio/9.png)
+![example in the SMS template](/docs/img/guides/auth-twilio/9.png)
### Using OTP with password based logins
@@ -99,12 +99,12 @@ In this scenario we'll be using the user's mobile phone number and a correspondi
Using supabase-js on the client you'll want to use the same `signUp` method that you'd use for email based sign ups, but with the `phone` param instead of the `email param`:
<Tabs
-defaultValue="JS"
-values={[
- {label: 'JavaScript', value: 'JS'},
- {label: 'HTTP', value: 'HTTP'},
-]}>
-<TabItem value="JS">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="js"
+>
+<TabPanel id="js" label="JavaScript">
```js
let { user, error } = await supabase.auth.signUp({
@@ -113,8 +113,8 @@ let { user, error } = await supabase.auth.signUp({
})
```
-</TabItem>
-<TabItem value="HTTP">
+</TabPanel>
+<TabPanel id="http" label="HTTP">
```bash
curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/signup' \
@@ -126,7 +126,7 @@ curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/signup' \
}'
```
-</TabItem>
+</TabPanel>
</Tabs>
The user will now receive an SMS with a 6-digit pin that you will need to receive from them within 60-seconds before they can login to their account.
@@ -134,12 +134,12 @@ The user will now receive an SMS with a 6-digit pin that you will need to receiv
You should present a form to the user so they can input the 6 digit pin, then send it along with the phone number to `verifyOTP`:
<Tabs
-defaultValue="JS"
-values={[
- {label: 'JavaScript', value: 'JS'},
- {label: 'HTTP', value: 'HTTP'},
-]}>
-<TabItem value="JS">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="js"
+>
+<TabPanel id="js" label="JavaScript">
```js
let { session, error } = await supabase.auth.verifyOTP({
@@ -149,8 +149,8 @@ let { session, error } = await supabase.auth.verifyOTP({
})
```
-</TabItem>
-<TabItem value="HTTP">
+</TabPanel>
+<TabPanel id="http" label="HTTP">
```bash
curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/verify' \
@@ -163,7 +163,7 @@ curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/verify' \
}'
```
-</TabItem>
+</TabPanel>
</Tabs>
If successful the user will now be logged in and you should receive a valid session like:
@@ -182,12 +182,12 @@ The access token can be sent in the Authorization header as a Bearer token for a
Also now that the mobile has been verified, the user can use the number and password to sign in without needing to verify their number each time:
<Tabs
-defaultValue="JS"
-values={[
- {label: 'JavaScript', value: 'JS'},
- {label: 'HTTP', value: 'HTTP'},
-]}>
-<TabItem value="JS">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="js"
+>
+<TabPanel id="js" label="JavaScript">
```js
let { user, error } = await supabase.auth.signInWithPassword({
@@ -196,8 +196,8 @@ let { user, error } = await supabase.auth.signInWithPassword({
})
```
-</TabItem>
-<TabItem value="HTTP">
+</TabPanel>
+<TabPanel id="http" label="HTTP">
```bash
curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/token?grant_type=password' \
@@ -209,7 +209,7 @@ curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/token?grant_type=
}'
```
-</TabItem>
+</TabPanel>
</Tabs>
### Using OTP as a passwordless sign-in mechanism
@@ -219,12 +219,12 @@ In this scenario you are granting your user's the ability to login to their acco
In javascript we can use the `signIn` method with a single parameter: `phone`
<Tabs
-defaultValue="JS"
-values={[
- {label: 'JavaScript', value: 'JS'},
- {label: 'HTTP', value: 'HTTP'},
-]}>
-<TabItem value="JS">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="js"
+>
+<TabPanel id="js" label="JavaScript">
```js
let { user, error } = await supabase.auth.signInWithOtp({
@@ -232,8 +232,8 @@ let { user, error } = await supabase.auth.signInWithOtp({
})
```
-</TabItem>
-<TabItem value="HTTP">
+</TabPanel>
+<TabPanel id="http" label="HTTP">
```bash
curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/otp' \
@@ -244,18 +244,18 @@ curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/otp' \
}'
```
-</TabItem>
+</TabPanel>
</Tabs>
The second step is the same as the previous section, you need to collect the 6-digit pin from the user and pass it along with their phone number to the verify method:
<Tabs
-defaultValue="JS"
-values={[
- {label: 'JavaScript', value: 'JS'},
- {label: 'HTTP', value: 'HTTP'},
-]}>
-<TabItem value="JS">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="js"
+>
+<TabPanel id="js" label="JavaScript">
```js
let { session, error } = await supabase.auth.verifyOTP({
@@ -265,8 +265,8 @@ let { session, error } = await supabase.auth.verifyOTP({
})
```
-</TabItem>
-<TabItem value="HTTP">
+</TabPanel>
+<TabPanel id="http" label="HTTP">
```bash
curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/verify' \
@@ -279,7 +279,7 @@ curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/verify' \
}'
```
-</TabItem>
+</TabPanel>
</Tabs>
and the response should also be the same as above:
diff --git a/apps/temp-docs/docs/guides/auth/auth-vonage.mdx b/apps/temp-docs/docs/guides/auth/auth-vonage.mdx
index 10fa9378c0c..27b01e29092 100644
--- a/apps/temp-docs/docs/guides/auth/auth-vonage.mdx
+++ b/apps/temp-docs/docs/guides/auth/auth-vonage.mdx
@@ -73,12 +73,12 @@ In this use scenario we'll be using the user's mobile phone number as an alterna
Using supabase-js on the client you'll want to use the same `signUp` method that you'd use for email based sign ups, but with the `phone` param instead of the `email param`:
<Tabs
-defaultValue="JS"
-values={[
- {label: 'JavaScript', value: 'JS'},
- {label: 'HTTP', value: 'HTTP'},
-]}>
-<TabItem value="JS">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="js"
+>
+<TabPanel id="js" label="JavaScript">
```js
let { user, error } = await supabase.auth.signUp({
@@ -87,8 +87,8 @@ let { user, error } = await supabase.auth.signUp({
})
```
-</TabItem>
-<TabItem value="HTTP">
+</TabPanel>
+<TabPanel id="http" label="HTTP">
```bash
curl -X POST 'https://xxx.supabase.co/auth/v1/signup' \
@@ -100,7 +100,7 @@ curl -X POST 'https://xxx.supabase.co/auth/v1/signup' \
}'
```
-</TabItem>
+</TabPanel>
</Tabs>
The user will now receive an SMS with a 6-digit pin that you will need to receive from them within 60-seconds before they can login to their account.
@@ -108,12 +108,12 @@ The user will now receive an SMS with a 6-digit pin that you will need to receiv
You should present a form to the user so they can input the 6 digit pin, then send it along with the phone number to `verifyOTP`:
<Tabs
-defaultValue="JS"
-values={[
- {label: 'JavaScript', value: 'JS'},
- {label: 'HTTP', value: 'HTTP'},
-]}>
-<TabItem value="JS">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="js"
+>
+<TabPanel id="js" label="JavaScript">
```js
let { session, error } = await supabase.auth.verifyOTP({
@@ -122,8 +122,8 @@ let { session, error } = await supabase.auth.verifyOTP({
})
```
-</TabItem>
-<TabItem value="HTTP">
+</TabPanel>
+<TabPanel id="http" label="HTTP">
```bash
curl -X POST 'https://xxx.supabase.co/auth/v1/verify' \
@@ -136,7 +136,7 @@ curl -X POST 'https://xxx.supabase.co/auth/v1/verify' \
}'
```
-</TabItem>
+</TabPanel>
</Tabs>
If successful the user will now be logged in and you should receive a valid session like:
@@ -155,12 +155,12 @@ The access token can be sent in the Authorization header as a Bearer token for a
Also now that the mobile has been verified, the user can use the number and password to sign in without needing to verify their number each time:
<Tabs
-defaultValue="JS"
-values={[
- {label: 'JavaScript', value: 'JS'},
- {label: 'HTTP', value: 'HTTP'},
-]}>
-<TabItem value="JS">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="js"
+>
+<TabPanel id="js" label="JavaScript">
```js
let { user, error } = await supabase.auth.signInWithPassword({
@@ -169,8 +169,8 @@ let { user, error } = await supabase.auth.signInWithPassword({
})
```
-</TabItem>
-<TabItem value="HTTP">
+</TabPanel>
+<TabPanel id="http" label="HTTP">
```bash
curl -X POST 'https://xxx.supabase.co/auth/v1/token?grant_type=password' \
@@ -182,7 +182,7 @@ curl -X POST 'https://xxx.supabase.co/auth/v1/token?grant_type=password' \
}'
```
-</TabItem>
+</TabPanel>
</Tabs>
### Using OTP as a passwordless sign-in mechanism
@@ -192,12 +192,12 @@ In this scenario you are granting your user's the ability to login to their acco
In javascript we can use the `signIn` method with a single parameter: `phone`
<Tabs
-defaultValue="JS"
-values={[
- {label: 'JavaScript', value: 'JS'},
- {label: 'HTTP', value: 'HTTP'},
-]}>
-<TabItem value="JS">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="js"
+>
+<TabPanel id="js" label="JavaScript">
```js
let { user, error } = await supabase.auth.signInWithOtp({
@@ -205,8 +205,8 @@ let { user, error } = await supabase.auth.signInWithOtp({
})
```
-</TabItem>
-<TabItem value="HTTP">
+</TabPanel>
+<TabPanel id="http" label="HTTP">
```bash
curl -X POST 'https://xxx.supabase.co/auth/v1/otp' \
@@ -217,18 +217,18 @@ curl -X POST 'https://xxx.supabase.co/auth/v1/otp' \
}'
```
-</TabItem>
+</TabPanel>
</Tabs>
The second step is the same as the previous section, you need to collect the 6-digit pin from the user and pass it along with their phone number to the verify method:
<Tabs
-defaultValue="JS"
-values={[
- {label: 'JavaScript', value: 'JS'},
- {label: 'HTTP', value: 'HTTP'},
-]}>
-<TabItem value="JS">
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="js"
+>
+<TabPanel id="js" label="JavaScript">
```js
let { session, error } = await supabase.auth.verifyOTP({
@@ -237,8 +237,8 @@ let { session, error } = await supabase.auth.verifyOTP({
})
```
-</TabItem>
-<TabItem value="HTTP">
+</TabPanel>
+<TabPanel id="http" label="HTTP">
```bash
curl -X POST 'https://xxx.supabase.co/auth/v1/verify' \
@@ -251,7 +251,7 @@ curl -X POST 'https://xxx.supabase.co/auth/v1/verify' \
}'
```
-</TabItem>
+</TabPanel>
</Tabs>
and the response should also be the same as above: