Files
supabase/apps/reference/_supabase_js_versioned_docs/version-v1/auth-signout.mdx
2022-08-15 11:18:27 +02:00

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()
```