You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 10, 2025. It is now read-only.
Although signOut clears the session data from local storage, it appears it leaves the user jwt in the gotrue headers object and in a second object called changedAccessToken.
If you run getUser() after signOut a request to the server goes out and the user data is returned.
Although database API calls revert to the anon key, the jwt could also be copied and used until it expires.
A temporary solution is probably to set the client "object" to null, or reinitialize the client if further work needs to be done after signout.
To Reproduce
console.log('login')
const {data} = await supabase1.auth.signInWithPassword({email: 'email', password:'pass'} )
console.log('login ',data)
console.log('signOut ',await supabase1.auth.signOut())
console.log('getSession ', await supabase1.auth.getSession()) //null
console.log('supabase ',supabase1) //see image below
const result = await supabase1.from('realtest').select() //authentication header anon
console.log ('getUser ', await supabase1.auth.getUser()) //auth header has user jwt and returns user data from server
Supabase object after signOut()
getUser going out with a user jwt after signOut().
Expected behavior
SignOut() should remove any jwt info from memory and certainly no allow gotrue operations to continue.
It is understood there is a risk of unexpired jwts after signOut, but they should not be left around for someone to find or use after signOut().
System information
supabase-js 2.0.4
jdgamble555, bobtechinsider, mrmikardo and Gbuomprisco