Thomas
Thomas

Reputation: 454

Supabase "Auth session missing!" after verifyOtp

I use verifyOtp with phone number and but I am getting this error. Any tips? The code works perfectly fine in production and on my colleagues machine but not mine. I've tried clear cookies etc

 ⨯ Internal error: AuthSessionMissingError: Auth session missing!
    at eval (./node_modules/@supabase/auth-js/dist/module/GoTrueClient.js:888:59)
    at SupabaseAuthClient._useSession (./node_modules/@supabase/auth-js/dist/module/GoTrueClient.js:790:26)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async SupabaseAuthClient._getUser (./node_modules/@supabase/auth-js/dist/module/GoTrueClient.js:880:20)
    at async eval (./node_modules/@supabase/auth-js/dist/module/GoTrueClient.js:867:20)
digest: "3861956798"

Upvotes: 2

Views: 713

Answers (1)

josacky
josacky

Reputation: 146

I'm suspecting it could be an issue where getUser is called instead of getSession. Try replacing getSession with getUser

getUser errors if there is no session in the supabase client or you don't provide. getSession will return null if there is no session.

Source

Upvotes: 0

Related Questions