Supabase error refresh_token_not_found (refresh_token_not_found) explained: what it means, why it happens, and how to fix it — with copy-paste code examples.
Force the user to sign in again - the session can no longer be refreshed. If that does not apply, handle SIGNED_OUT from onAuthStateChange and redirect to login — the full checklist is below.
Error code: refresh_token_not_found
Official name: refresh_token_not_found
Service: Supabase
Session containing the refresh token not found.
const { error } = await supabase.auth.getSession()
if (error?.code === 'refresh_token_not_found') {
await supabase.auth.signOut({ scope: 'local' })
window.location.href = '/login'
}
Once the refresh token is gone the session is unrecoverable - a clean local sign-out avoids stuck UI state.
Catch the code and clean up local state before redirecting to login.
const { error } = await supabase.auth.refreshSession()
if (error?.code === 'refresh_token_not_found') {
await supabase.auth.signOut()
redirectToLogin()
}
Most often this happens when refresh token rotated (single-use) and then reused, or when user signed out on another device, revoking the session.
Force the user to sign in again - the session can no longer be refreshed.
This page documents fixes for: supabase-js.
Recommendations are editorial — DB Error Reference takes no payment or affiliate fees for tool listings.
This page is based on the official Supabase documentation linked below and adds practical troubleshooting guidance on top.