nuxt-modules / supabase

Supabase module for Nuxt.
https://supabase.nuxtjs.org
MIT License
733 stars 129 forks source link

Setting persistSession: false still persists auth session #390

Open AccountingSystems opened 4 months ago

AccountingSystems commented 4 months ago

I don't want to persist the auth session in my project, so in my nuxt.config.ts I set persistSession: false. But the auth session still persists and I can retrieve it when I try to get the current user await useSupabaseClient().auth.getUser()

Version

@nuxtjs/supabase: nuxt:

Steps to reproduce

  1. Create a new project with the specified dependency versions
  2. Set your supabase section in nuxt.config.ts to
    supabase: {
    cookieOptions: {
      secure: process.env.NODE_ENV === "production",
    },
    clientOptions: {
      auth: {
        persistSession: false,
      },
    },
    }
  3. Sign in
  4. close the website
  5. re-open the website
  6. Check for authentication status

What is Expected?

The authentication state is clear and no session or user currently exists/authenticated

What is actually happening?

The previously signed in user is authenticated and can be retrieved from the supabase client.