Hey I'm using Nuxt 3.0.0 and have this in auth.global.ts in /middleware:
export default defineNuxtRouteMiddleware((to, from) => {
const accessToken = computed(() => useUserStore().$state.accessToken);
console.log(useUserStore().$state);
}```
And on refresh, the $state is giving the initial state and not the current state, so accessToken is always undefined even if my user is logged in. What am I doing wrong? I know Pinia is instantiated after middlewares but I see examples of people doing this online but can't see why mine isn't working this way.