signOut works but signs back in after refresh in NUXT

I added a pages directory to the Nuxt3 & supbase starter app tutorial (https://supabase.com/docs/guides/with-nuxt-3) and now the signOut function is broken, ie user remains signed in if browser is refreshed. Unsure how I broke it.

Only things I changed from template include:

pages/index.vue
<template>
    <main>
    <div class="container" style="padding: 50px 0 100px 0">

        <Account v-if="user" />

        <Auth v-else />

    </div>
    </main>
</template>

<script setup>

const user = useSupabaseUser()
  
</script>

app.vue
<template>

  <NuxtLayout>
  </NuxtLayout>
  
</template>


<script setup>

  const user = useSupabaseUser()

</script>


layouts/default.vue
<template>
    <div>
        <NuxtPage />
    </div>
</template>


Basically, I broke the signOut function when trying to add a pages directory. Any idea whats going on here? Thank you so much!
Supabase Documentation
Learn how to use Supabase in your Nuxt 3 App.
Was this page helpful?