await useAsyncData in setup doesn't block navigation
I want to wait until navigating to the next page until the store data has been fetched and set.
I'm using Nuxt 3 + Supabase + Pinia
My approach in
provider.vue
(where user gets redirected after signing in/up to set cookies etc.)
app.vue
: fetch store data. I'm hoping to block navigation by using await useAsyncData
my store (reduced data for demonstration purpose)
... however, after the provider.vue
redirects me, this value is undefined in one of my composables:
const { company } = storeToRefs(useUserStore())
How can I make the application wait until the store has been set?0 Replies