update auth docs

This commit is contained in:
Inian committed 2022-08-16 14:18:14 +08:00
1 parent 9976664354
commit 28bd73c021
10 files changed
+9659 -30268

No files matched your search

@@ -9,6 +9,7 @@ import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Returns the session data, refreshing it if necessary.
If no session is detected, the session returned will be null.
```js
const session = supabase.auth.session()
@@ -8,12 +8,38 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Returns the user data, refreshing the session if necessary.
Gets the current user details if there is an existing session.
```js
const user = supabase.auth.user()
```
## Parameters
<ul className="method-list-group">
<li className="method-list-item">
<h4 className="method-list-item-label">
<span className="method-list-item-label-name">
jwt
</span>
<span className="method-list-item-label-badge false">
optional
</span>
<span className="method-list-item-validation">
<code>string</code>
</span>
</h4>
<div class="method-list-item-description">
Takes in an optional access token jwt. If no jwt is provided, getUser() will attempt to get the jwt from the current session.
</div>
</li>
</ul>
## Notes
This method gets the user object from memory.
@@ -34,7 +34,7 @@ supabase.auth.onAuthStateChange((event, session) => {
</h4>
<div class="method-list-item-description">
No description provided.
A callback function to be invoked when an auth event happens.
</div>
@@ -8,7 +8,7 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Sets the session data from refresh_token and returns current Session and Error
Sets the session data from refresh_token and returns current session or an error if the refresh_token is invalid.
```js
function apiFunction(req, res) {
@@ -42,7 +42,7 @@ function apiFunction(req, res) {
</h4>
<div class="method-list-item-description">
a JWT token
The refresh token returned by gotrue.
</div>
@@ -56,7 +56,7 @@ No description provided.
</h4>
<div class="method-list-item-description">
No description provided.
One of the providers supported by GoTrue.
</div>
@@ -11,7 +11,8 @@ import TabItem from '@theme/TabItem'
Inside a browser context, `signOut()` will remove the logged in user from the browser session
and log them out - removing all items from localstorage and then trigger a "SIGNED_OUT" event.
For server-side management, you can revoke all refresh tokens for a user by passing a user's JWT through to `auth.api.signOut(JWT: string)`. There is no way to revoke a user's session JWT before it automatically expires
For server-side management, you can revoke all refresh tokens for a user by passing a user's JWT through to `auth.api.signOut(JWT: string)`.
There is no way to revoke a user's access token jwt until it expires. It is recommended to set a shorter expiry on the jwt for this reason.
```js
const { error } = await supabase.auth.signOut()
@@ -56,27 +56,7 @@ No description provided.
</h4>
<div class="method-list-item-description">
No description provided.
</div>
</li>
<li className="method-list-item">
<h4 className="method-list-item-label">
<span className="method-list-item-label-name">
oidc
</span>
<span className="method-list-item-label-badge false">
optional
</span>
<span className="method-list-item-validation">
<code>OpenIDConnectCredentials</code>
</span>
</h4>
<div class="method-list-item-description">
No description provided.
The user's email address.
</div>
@@ -96,7 +76,7 @@ No description provided.
</h4>
<div class="method-list-item-description">
No description provided.
The user's password.
</div>
@@ -116,7 +96,7 @@ No description provided.
</h4>
<div class="method-list-item-description">
No description provided.
The user's phone number.
</div>
@@ -201,7 +181,7 @@ No description provided.
</h4>
<div class="method-list-item-description">
No description provided.
Verification token received when the user completes the captcha on the site.
</div>
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff