mirror of
https://github.com/supabase/supabase.git
synced 2026-07-05 12:14:27 +08:00
27 lines
785 B
Plaintext
27 lines
785 B
Plaintext
---
|
|
id: auth-signout
|
|
title: 'signOut()'
|
|
slug: auth-signout
|
|
custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v1_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 session JWT before it automatically expires
|
|
|
|
```js
|
|
const { error } = await supabase.auth.signOut()
|
|
```
|
|
|
|
## Examples
|
|
|
|
### Sign out
|
|
|
|
```js
|
|
const { error } = await supabase.auth.signOut()
|
|
```
|