mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
Fix Kotlin OTP Auth docs (#20988)
* Fix auth docs * fix typo * Clarify sending otps
This commit is contained in:
1 parent
30d60342df
commit
c59da45a3e
2 files changed
+28
-4
No files matched your search
@@ -86,6 +86,15 @@ If the request was successful, you receive a response with `error: null` and a `
|
||||
|
||||
## Verify OTP to create session
|
||||
|
||||
<Tabs
|
||||
scrollable
|
||||
size="small"
|
||||
type="underlined"
|
||||
defaultActiveId="js"
|
||||
queryGroup="language"
|
||||
>
|
||||
<TabPanel id="js" label="JavaScript">
|
||||
|
||||
Provide an input field for the user to key in the one-time code. To verify the code and complete the user's sign in, call [verifyOtp()](/docs/reference/javascript/auth-verifyotp) with their email address, the code, and `type: "email"`:
|
||||
|
||||
```js
|
||||
@@ -99,6 +108,18 @@ const {
|
||||
})
|
||||
```
|
||||
|
||||
</TabPanel>
|
||||
<TabPanel id="kotlin" label="Kotlin">
|
||||
|
||||
Provide an input field for the user to key in the one-time code. To verify the code and complete the user's sign in, call [verifyEmailOtp()](/docs/reference/kotlin/auth-verifyotp) with their email address, the code, and `OtpType.Email.EMAIL` as the type:
|
||||
|
||||
```kotlin
|
||||
supabase.auth.verifyEmailOtp(type = OtpType.Email.EMAIL, email = "email", token = "151345")
|
||||
```
|
||||
|
||||
</TabPanel>
|
||||
</Tabs>
|
||||
|
||||
If successful the user will now be logged in and you should receive a valid session like:
|
||||
|
||||
```json
|
||||
|
||||
@@ -2528,6 +2528,7 @@ functions:
|
||||
- Requires either an email or phone number.
|
||||
- This method is used for passwordless sign-ins where a OTP is sent to the user's email or phone number.
|
||||
- If the user doesn't exist, `signInWith(OTP)` will signup the user instead. To restrict this behavior, you can set `createUser` to `false`.
|
||||
- The method `signUpWith(OTP)` does the exact same thing as `signInWith(OTP)`, so it doesn't matter which one you use.
|
||||
- If you're using an email, you can configure whether you want the user to receive a magiclink or a OTP.
|
||||
- If you're using phone, you can configure whether you want the user to receive a OTP.
|
||||
- The magic link's destination URL is determined by the [`SITE_URL`](/docs/reference/auth/config#site_url).
|
||||
@@ -2677,22 +2678,24 @@ functions:
|
||||
title: 'Verify OTPs'
|
||||
$ref: '@supabase/gotrue-js.GoTrueClient.verifyOtp'
|
||||
notes: |
|
||||
Log in a user given a User supplied OTP received via mobile.
|
||||
- Verifying an OTP is done through either `verifyPhoneOtp` or `verifyEmailOtp`.
|
||||
- The verification type used should be determined based on the corresponding auth method called before using `verifyPhoneOtp`/`verifyEmailOtp` to sign up / sign-in a user.
|
||||
examples:
|
||||
- id: verify-email-otp(otp)
|
||||
name: Verify an Email OTP
|
||||
isSpotlight: true
|
||||
code: |
|
||||
```kotlin
|
||||
supabase.auth.verifyEmailOtp(type = OtpType.Email.INVITE, email = "example@email.com", token = "token")
|
||||
supabase.auth.verifyEmailOtp(type = OtpType.Email.EMAIL, email = "example@email.com", token = "token")
|
||||
```
|
||||
description: |
|
||||
Available types are:
|
||||
- `OtpType.Email.MAGIC_LINK`
|
||||
- `OtpType.Email.SIGNUP`
|
||||
- `OtpType.Email.MAGIC_LINK` (deprecated)
|
||||
- `OtpType.Email.SIGNUP` (deprecated)
|
||||
- `OtpType.Email.INVITE`
|
||||
- `OtpType.Email.RECOVERY`
|
||||
- `OtpType.Email.EMAIL_CHANGE`
|
||||
- `OtpType.Email.EMAIL`
|
||||
- id: verify-phone-otp(otp)
|
||||
name: Verify an Phone OTP
|
||||
isSpotlight: false
|
||||
|
||||
Reference in new issue
Block a user