mirror of
https://github.com/supabase/supabase.git
synced 2026-07-05 02:24:20 +08:00
28 lines
847 B
Plaintext
28 lines
847 B
Plaintext
---
|
|
id: auth-signout
|
|
title: 'signOut()'
|
|
slug: /auth-signout
|
|
custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v2_legacy.yml
|
|
---
|
|
|
|
import Tabs from '@theme/Tabs'
|
|
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 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()
|
|
```
|
|
|
|
## Examples
|
|
|
|
### Sign out
|
|
|
|
```js
|
|
const { error } = await supabase.auth.signOut()
|
|
```
|