shadab
shadab

Reputation: 41

how to provide storage option to persist the session, using next.js 13 and supabase

I have problem with next-auth, when I login the result of logging is ({error: 'SessionRequired', status: 200, ok: true, url: null}), even though when I check there is an active session, a got this error in the console also, I thought they maybe relatable :

(No storage option exists to persist the session, which may result in unexpected behavior when using auth. If you want to set persistSession to true, please provide a storage option or you may set persistSession to false to disable this warning.)

I'm using supabase and nextJs 13 in my project, how can pevent this error from happening?

Upvotes: 0

Views: 562

Answers (1)

Manbus
Manbus

Reputation: 1026

Do this:

{
  global: { 
     headers: { 
        Authorization: req.headers.get("Authorization")! 
     } 
  },
  auth: {
    detectSessionInUrl: false,
    autoRefreshToken: false,
    persistSession: false,
  }
}

Upvotes: 0

Related Questions