signOut()
Signature
massi.auth.signOut(): Promise<{ error: MassiError | null }>Example
const { error } = await massi.auth.signOut()
if (error) { console.error('Sign out failed:', error.message)}// Session cleared — massi.auth.getUser() now returns nullWhat it does
- Sends a POST to
/auth/logoutto invalidate the refresh token on the server - Removes the session from local storage (or your custom storage)
- Triggers
onAuthStateChangewithSIGNED_OUT
Notes
- Even if the network call fails, the local session is cleared.
- After sign-out, subsequent calls that require authentication will return
401unless you sign in again.