forked from supabase/supabase
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
881 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,6 +80,15 @@ Call the [`signInAnonymously()`](/docs/reference/kotlin/auth-signinanonymously) | |
supabase.auth.signInAnonymously() | ||
``` | ||
|
||
</TabPanel> | ||
<TabPanel id="python" label="Python"> | ||
|
||
Call the [`sign_in_anonymously()`](/docs/reference/python/auth-signinanonymously) method: | ||
|
||
```python | ||
response = supabase.auth.sign_in_anonymously() | ||
``` | ||
|
||
</TabPanel> | ||
</Tabs> | ||
|
||
|
@@ -141,6 +150,25 @@ supabase.auth.modifyUser { | |
} | ||
``` | ||
|
||
</TabPanel> | ||
<TabPanel id="python" label="Python"> | ||
|
||
You can use the [`update_user()`](/docs/reference/python/auth-updateuser) method to link an email or phone identity to the anonymous user. To add a password for the anonymous user, the user's email or phone number needs to be verified first. | ||
|
||
```python | ||
response = supabase.auth.update_user({ | ||
'email': '[email protected]', | ||
}) | ||
|
||
# verify the user's email by clicking on the email change link | ||
# or entering the 6-digit OTP sent to the email address | ||
|
||
# once the user has been verified, update the password | ||
response = supabase.auth.update_user({ | ||
'password': 'password', | ||
}) | ||
``` | ||
|
||
</TabPanel> | ||
</Tabs> | ||
|
||
|
@@ -188,6 +216,15 @@ You can use the [`linkIdentity()`](/docs/reference/kotlin/auth-linkidentity) met | |
supabase.auth.linkIdentity(Google) | ||
``` | ||
|
||
</TabPanel> | ||
<TabPanel id="python" label="Python"> | ||
|
||
You can use the [`link_identity()`](/docs/reference/python/auth-linkidentity) method to link an oauth identity to the anonymous user. | ||
|
||
```python | ||
response = supabase.auth.link_identity({'provider': 'google'}) | ||
``` | ||
|
||
</TabPanel> | ||
</Tabs> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,6 +108,20 @@ suspend fun signInWithEmail() { | |
} | ||
``` | ||
|
||
</TabPanel> | ||
<TabPanel id="python" label="Python"> | ||
|
||
```python | ||
response = supabase.auth.sign_in_with_otp({ | ||
'email': '[email protected]', | ||
'options': { | ||
# set this to false if you do not want the user to be automatically signed up | ||
'should_create_user': False, | ||
'email_redirect_to': 'https://example.com/welcome', | ||
}, | ||
}) | ||
``` | ||
|
||
</TabPanel> | ||
</Tabs> | ||
|
||
|
@@ -206,6 +220,19 @@ suspend fun signInWithEmailOtp() { | |
} | ||
``` | ||
|
||
</TabPanel> | ||
<TabPanel id="python" label="Python"> | ||
|
||
```python | ||
response = supabase.auth.sign_in_with_otp({ | ||
'email': '[email protected]', | ||
'options': { | ||
# set this to false if you do not want the user to be automatically signed up | ||
'should_create_user': False, | ||
}, | ||
}) | ||
``` | ||
|
||
</TabPanel> | ||
</Tabs> | ||
|
||
|
@@ -265,6 +292,17 @@ try await supabase.auth.verifyOTP( | |
supabase.auth.verifyEmailOtp(type = OtpType.Email.EMAIL, email = "email", token = "151345") | ||
``` | ||
|
||
</TabPanel> | ||
<TabPanel id="python" label="Python"> | ||
|
||
```python | ||
response = supabase.auth.verify_otp({ | ||
'email': email, | ||
'token': '123456', | ||
'type': 'email', | ||
}) | ||
``` | ||
|
||
</TabPanel> | ||
</Tabs> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,6 +112,25 @@ suspend fun signUpNewUser() { | |
} | ||
``` | ||
|
||
</TabPanel> | ||
<TabPanel id="python" label="Python"> | ||
|
||
To sign up the user, call [signUp()](/docs/reference/python/auth-signup) with their email address and password. | ||
|
||
You can optionally specify a URL to redirect to after the user clicks the confirmation link. This URL must be configured as a [Redirect URL](/docs/guides/auth/redirect-urls), which you can do in the [dashboard](/dashboard/project/_/auth/url-configuration) for hosted projects, or in the [configuration file](/docs/guides/cli/config#auth.additional_redirect_urls) for self-hosted projects. | ||
|
||
If you don't specify a redirect URL, the user is automatically redirected to your site URL. This defaults to `localhost:3000`, but you can also configure this. | ||
|
||
```python | ||
data = await supabase.auth.sign_up({ | ||
'email': '[email protected]', | ||
'password': 'example-password', | ||
'options': { | ||
'email_redirect_to': 'https://example.com/welcome', | ||
}, | ||
}) | ||
``` | ||
|
||
</TabPanel> | ||
</Tabs> | ||
|
||
|
@@ -411,6 +430,18 @@ suspend fun signUpNewUser() { | |
} | ||
``` | ||
</TabPanel> | ||
<TabPanel id="python" label="Python"> | ||
To sign up the user, call [signUp()](/docs/reference/python/auth-signup) with their email address and password: | ||
```python | ||
data = supabase.auth.sign_up({ | ||
'email': '[email protected]', | ||
'password': 'example-password', | ||
}) | ||
``` | ||
</TabPanel> | ||
</Tabs> | ||
|
@@ -479,6 +510,18 @@ suspend fun signInWithEmail() { | |
} | ||
``` | ||
</TabPanel> | ||
<TabPanel id="python" label="Python"> | ||
When your user signs in, call [sign_in_with_password()](/docs/reference/python/auth-signinwithpassword) with their email address and password: | ||
```python | ||
data = client.auth.sign_in_with_password({ | ||
'email': '[email protected]', | ||
'password': 'example-password', | ||
}) | ||
``` | ||
</TabPanel> | ||
</Tabs> | ||
|
@@ -535,6 +578,16 @@ supabase.gotrue.sendRecoveryEmail( | |
If you are on one of the Kotlin targets that have built-in support for redirect URL handling, such as Android, see [OAuth and OTP link verification](https://supabase.com/docs/reference/kotlin/initializing). | ||
</TabPanel> | ||
<TabPanel id="python" label="Python"> | ||
```python | ||
client.auth.reset_password_email( | ||
'[email protected]', | ||
{'redirect_to':'http://example.com/account/update-password'} | ||
) | ||
``` | ||
</TabPanel> | ||
</Tabs> | ||
|
@@ -812,6 +865,13 @@ supabase.gotrue.sendRecoveryEmail( | |
) | ||
``` | ||
</TabPanel> | ||
<TabPanel id="python" label="Python"> | ||
```python | ||
supabase.auth.reset_password_email('[email protected]') | ||
``` | ||
</TabPanel> | ||
</Tabs> | ||
|
@@ -850,6 +910,13 @@ supabase.auth.updateUser { | |
} | ||
``` | ||
</TabPanel> | ||
<TabPanel id="python" label="Python"> | ||
```python | ||
supabase.auth.update_user({'password': 'new_password'}) | ||
``` | ||
</TabPanel> | ||
</Tabs> | ||
|
@@ -936,6 +1003,16 @@ supabase.auth.signUpWith(Phone) { | |
} | ||
``` | ||
</TabPanel> | ||
<TabPanel id="python" label="Python"> | ||
```python | ||
supabase.auth.sign_up({ | ||
'phone': "+13334445555", | ||
'password': "some-password" | ||
}) | ||
``` | ||
</TabPanel> | ||
<TabPanel id="http" label="HTTP"> | ||
|
@@ -1002,6 +1079,19 @@ supabase.auth.verifyPhoneOtp( | |
) | ||
``` | ||
</TabPanel> | ||
<TabPanel id="python" label="Python"> | ||
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 `verify_otp`: | ||
```python | ||
supabase.auth.verify_otp({ | ||
'phone': "+13334445555", | ||
'token': "123456", | ||
'type': "sms" | ||
}) | ||
``` | ||
</TabPanel> | ||
<TabPanel id="http" label="HTTP"> | ||
|
@@ -1059,6 +1149,16 @@ supabase.auth.signInWith(Phone) { | |
} | ||
``` | ||
</TabPanel> | ||
<TabPanel id="python" label="Python"> | ||
```python | ||
supabase.auth.sign_in_with_password({ | ||
'phone': "+13334445555" | ||
'password': "some-password" | ||
}) | ||
``` | ||
</TabPanel> | ||
<TabPanel id="http" label="HTTP"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.