mirror of
https://github.com/supabase/supabase.git
synced 2026-06-09 19:50:28 +08:00
chore: update app.supabase.io links to app.supabase.com
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
---
|
||||
id: auth-signin
|
||||
title: "signIn()"
|
||||
title: 'signIn()'
|
||||
slug: auth-signin
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabsPanel from '@theme/TabsPanel';
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabsPanel from '@theme/TabsPanel'
|
||||
|
||||
Log in an existing user, or login via a third-party provider.
|
||||
|
||||
@@ -24,14 +24,12 @@ const { user, session, error } = await supabase.auth.signIn({
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
</TabsPanel>
|
||||
|
||||
</Tabs>
|
||||
|
||||
## Parameters
|
||||
|
||||
|
||||
<ul className="method-list-group">
|
||||
|
||||
<li className="method-list-item">
|
||||
@@ -48,13 +46,12 @@ const { user, session, error } = await supabase.auth.signIn({
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
No description provided.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
@@ -69,7 +66,7 @@ No description provided.
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
No description provided.
|
||||
|
||||
</div>
|
||||
|
||||
@@ -90,13 +87,12 @@ No description provided.
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
No description provided.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
@@ -111,7 +107,7 @@ No description provided.
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
No description provided.
|
||||
|
||||
</div>
|
||||
|
||||
@@ -123,29 +119,17 @@ No description provided.
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
## Notes
|
||||
|
||||
- A user can sign up either via email or OAuth.
|
||||
- If you provide `email` without a `password`, the user will be sent a magic link.
|
||||
- The magic link's destination URL is determined by the SITE_URL config variable. To change this, you can go to Authentication -> Settings on [app.supabase.io](https://app.supabase.io)
|
||||
- The magic link's destination URL is determined by the SITE_URL config variable. To change this, you can go to Authentication -> Settings on [app.supabase.com](https://app.supabase.com)
|
||||
- Specifying a `provider` will open the browser to the relevant login page.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Sign in with email.
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultActiveId="js"
|
||||
groupId="reference/supabase-js"
|
||||
@@ -160,7 +144,6 @@ const { user, session, error } = await supabase.auth.signIn({
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
</TabsPanel>
|
||||
|
||||
</Tabs>
|
||||
@@ -178,11 +161,10 @@ If no password is provided, the user will be sent a "magic link" to their email
|
||||
|
||||
```js
|
||||
const { user, session, error } = await supabase.auth.signIn({
|
||||
email: 'example@email.com'
|
||||
email: 'example@email.com',
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
</TabsPanel>
|
||||
|
||||
</Tabs>
|
||||
@@ -201,21 +183,19 @@ Supabase supports OAuth logins.
|
||||
```js
|
||||
const { user, session, error } = await supabase.auth.signIn({
|
||||
// provider can be 'github', 'google', 'gitlab', or 'bitbucket'
|
||||
provider: 'github'
|
||||
provider: 'github',
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
</TabsPanel>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### Sign in with redirect.
|
||||
|
||||
Sometimes you want to control where the user is redirected to after they are logged in. Supabase supports this for
|
||||
Sometimes you want to control where the user is redirected to after they are logged in. Supabase supports this for
|
||||
any URL path on your website (the base domain must be the same as the domain in your Auth settings).
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultActiveId="js"
|
||||
groupId="reference/supabase-js"
|
||||
@@ -224,14 +204,16 @@ any URL path on your website (the base domain must be the same as the domain in
|
||||
<TabsPanel id="js" label="js">
|
||||
|
||||
```js
|
||||
const { user, session, error } = await supabase.auth.signIn({
|
||||
provider: 'github'
|
||||
}, {
|
||||
redirectTo: 'https://example.com/welcome'
|
||||
})
|
||||
const { user, session, error } = await supabase.auth.signIn(
|
||||
{
|
||||
provider: 'github',
|
||||
},
|
||||
{
|
||||
redirectTo: 'https://example.com/welcome',
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
|
||||
</TabsPanel>
|
||||
|
||||
</Tabs>
|
||||
@@ -241,7 +223,6 @@ const { user, session, error } = await supabase.auth.signIn({
|
||||
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.
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultActiveId="js"
|
||||
groupId="reference/supabase-js"
|
||||
@@ -250,15 +231,17 @@ You may also need to specify the scopes in the provider's OAuth app settings, de
|
||||
<TabsPanel id="js" label="js">
|
||||
|
||||
```js
|
||||
const { user, session, error } = await supabase.auth.signIn({
|
||||
provider: 'github'
|
||||
}, {
|
||||
scopes: 'repo gist notifications'
|
||||
})
|
||||
const { user, session, error } = await supabase.auth.signIn(
|
||||
{
|
||||
provider: 'github',
|
||||
},
|
||||
{
|
||||
scopes: 'repo gist notifications',
|
||||
}
|
||||
)
|
||||
const oAuthToken = session.provider_token // use to access provider API
|
||||
```
|
||||
|
||||
|
||||
</TabsPanel>
|
||||
|
||||
</Tabs>
|
||||
@@ -267,7 +250,6 @@ const oAuthToken = session.provider_token // use to access provider API
|
||||
|
||||
If you are completing a sign up or login in a React Native app you can pass the refresh token obtained from the provider to obtain a session.
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultActiveId="js"
|
||||
groupId="reference/supabase-js"
|
||||
@@ -277,21 +259,20 @@ If you are completing a sign up or login in a React Native app you can pass the
|
||||
|
||||
```js
|
||||
// An example using Expo's `AuthSession`
|
||||
const redirectUri = AuthSession.makeRedirectUri({ useProxy: false });
|
||||
const provider = 'google';
|
||||
const redirectUri = AuthSession.makeRedirectUri({ useProxy: false })
|
||||
const provider = 'google'
|
||||
|
||||
AuthSession.startAsync({
|
||||
authUrl: `https://MYSUPABASEAPP.supabase.co/auth/v1/authorize?provider=${provider}&redirect_to=${redirectUri}`,
|
||||
returnUrl: redirectUri,
|
||||
}).then(async (response: any) => {
|
||||
if (!response) return;
|
||||
if (!response) return
|
||||
const { user, session, error } = await supabase.auth.signIn({
|
||||
refreshToken: response.params?.refresh_token,
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
</TabsPanel>
|
||||
|
||||
</Tabs>
|
||||
</Tabs>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
---
|
||||
id: auth-signup
|
||||
title: "signUp()"
|
||||
title: 'signUp()'
|
||||
slug: auth-signup
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabsPanel from '@theme/TabsPanel';
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabsPanel from '@theme/TabsPanel'
|
||||
|
||||
Creates a new user.
|
||||
|
||||
@@ -24,14 +24,12 @@ const { user, session, error } = await supabase.auth.signUp({
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
</TabsPanel>
|
||||
|
||||
</Tabs>
|
||||
|
||||
## Parameters
|
||||
|
||||
|
||||
<ul className="method-list-group">
|
||||
|
||||
<li className="method-list-item">
|
||||
@@ -48,13 +46,12 @@ const { user, session, error } = await supabase.auth.signUp({
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
No description provided.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
@@ -69,7 +66,7 @@ No description provided.
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
No description provided.
|
||||
|
||||
</div>
|
||||
|
||||
@@ -90,13 +87,12 @@ No description provided.
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
No description provided.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
@@ -111,7 +107,7 @@ No description provided.
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
No description provided.
|
||||
|
||||
</div>
|
||||
|
||||
@@ -123,33 +119,21 @@ No description provided.
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
## Notes
|
||||
|
||||
- By default, the user will need to verify their email address before logging in. If you would like to change this, you can disable "Email Confirmations" by going to Authentication -> Settings on [app.supabase.io](https://app.supabase.io)
|
||||
- By default, the user will need to verify their email address before logging in. If you would like to change this, you can disable "Email Confirmations" by going to Authentication -> Settings on [app.supabase.com](https://app.supabase.com)
|
||||
- If "Email Confirmations" is turned on, a `user` is returned but `session` will be null
|
||||
- If "Email Confirmations" is turned off, both a `user` and a `session` will be returned
|
||||
- When the user confirms their email address, they will be redirected to localhost:3000 by default. To change this, you can go to Authentication -> Settings on [app.supabase.io](https://app.supabase.io)
|
||||
- When the user confirms their email address, they will be redirected to localhost:3000 by default. To change this, you can go to Authentication -> Settings on [app.supabase.com](https://app.supabase.com)
|
||||
- If signUp() is called for an existing confirmed user:
|
||||
- If "Enable email confirmations" is enabled on the "Authentication" -> "Settings" page, an obfuscated / fake user object will be returned.
|
||||
- If "Enable email confirmations" is disabled, an error with a message "User already registered" will be returned.
|
||||
- If "Enable email confirmations" is enabled on the "Authentication" -> "Settings" page, an obfuscated / fake user object will be returned.
|
||||
- If "Enable email confirmations" is disabled, an error with a message "User already registered" will be returned.
|
||||
- To check if a user already exists, refer to getUser().
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Sign up.
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultActiveId="js"
|
||||
groupId="reference/supabase-js"
|
||||
@@ -164,15 +148,12 @@ const { user, session, error } = await supabase.auth.signUp({
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
</TabsPanel>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### Sign up with additional user meta data.
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultActiveId="js"
|
||||
groupId="reference/supabase-js"
|
||||
@@ -187,19 +168,18 @@ const { user, session, error } = await supabase.auth.signUp(
|
||||
password: 'example-password',
|
||||
},
|
||||
{
|
||||
data: {
|
||||
first_name: 'John',
|
||||
data: {
|
||||
first_name: 'John',
|
||||
age: 27,
|
||||
}
|
||||
},
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
|
||||
</TabsPanel>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### Sign up with third-party providers.
|
||||
|
||||
You can sign up with OAuth providers using the [`signIn()`](/docs/reference/javascript/auth-signin#sign-in-using-third-party-providers) method.
|
||||
You can sign up with OAuth providers using the [`signIn()`](/docs/reference/javascript/auth-signin#sign-in-using-third-party-providers) method.
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
---
|
||||
id: storage-from-getpublicurl
|
||||
title: "from.getPublicUrl()"
|
||||
title: 'from.getPublicUrl()'
|
||||
slug: storage-from-getpublicurl
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabsPanel from '@theme/TabsPanel';
|
||||
import Tabs from '@theme/Tabs'
|
||||
import TabsPanel from '@theme/TabsPanel'
|
||||
|
||||
Retrieve URLs for assets in public buckets
|
||||
|
||||
@@ -18,20 +18,17 @@ Retrieve URLs for assets in public buckets
|
||||
<TabsPanel id="js" label="js">
|
||||
|
||||
```js
|
||||
const { publicURL, error } = supabase
|
||||
.storage
|
||||
const { publicURL, error } = supabase.storage
|
||||
.from('public-bucket')
|
||||
.getPublicUrl('folder/avatar1.png')
|
||||
```
|
||||
|
||||
|
||||
</TabsPanel>
|
||||
|
||||
</Tabs>
|
||||
|
||||
## Parameters
|
||||
|
||||
|
||||
<ul className="method-list-group">
|
||||
|
||||
<li className="method-list-item">
|
||||
@@ -56,29 +53,17 @@ The file path to be downloaded, including the path and file name. For example `f
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
## Notes
|
||||
|
||||
- The bucket needs to be set to public, either via [updateBucket()](/docs/reference/javascript/storage-updatebucket) or by going to Storage on [app.supabase.io](https://app.supabase.io), clicking the overflow menu on a bucket and choosing "Make public"
|
||||
- The bucket needs to be set to public, either via [updateBucket()](/docs/reference/javascript/storage-updatebucket) or by going to Storage on [app.supabase.com](https://app.supabase.com), clicking the overflow menu on a bucket and choosing "Make public"
|
||||
- Policy permissions required:
|
||||
- `buckets` permissions: none
|
||||
- `buckets` permissions: none
|
||||
- `objects` permissions: none
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Returns the URL for an asset in a public bucket
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultActiveId="js"
|
||||
groupId="reference/supabase-js"
|
||||
@@ -87,13 +72,11 @@ The file path to be downloaded, including the path and file name. For example `f
|
||||
<TabsPanel id="js" label="js">
|
||||
|
||||
```js
|
||||
const { publicURL, error } = supabase
|
||||
.storage
|
||||
const { publicURL, error } = supabase.storage
|
||||
.from('public-bucket')
|
||||
.getPublicUrl('folder/avatar1.png')
|
||||
```
|
||||
|
||||
|
||||
</TabsPanel>
|
||||
|
||||
</Tabs>
|
||||
</Tabs>
|
||||
|
||||
Reference in New Issue
Block a user