Sign out a user
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.
- In order to use the
signOut()
method, the user needs to be signed in first.
Parameters
- optionsOptionalSignOutscopeOptional"global" | "local" | "others"
Determines which sessions should be logged out. Global means all sessions by this account. Local means only this session. Others means all other sessions except the current one. When using others, there is no sign-out event fired on the current session!
const { error } = await supabase.auth.signOut()