Files
supabase/studio/components/interfaces/App/GoTrueWrapper/GoTrueWrapper.utils.ts

8 lines
284 B
TypeScript

export function doesTokenDataExist() {
// ignore if server-side
if (typeof window === 'undefined') return false
// check tokenData on localstorage
const tokenData = window?.localStorage['supabase.auth.token']
return tokenData != undefined && typeof tokenData === 'string'
}