Nuxt auth middleware with better-auth library
I'm using better-auth for authentication. I'm using a NuxtRouteMiddleware on protected pages so unauthenticated users are redirected to login. This is my middleware
When user navigates through the app, it works as expected. When user are loading a protected page as first page or reloading it, they're always redirected to /login.
I initialize my authStore in my default layout
How do I fix it so the middleware gets executed after the store is fully initialized?
When user navigates through the app, it works as expected. When user are loading a protected page as first page or reloading it, they're always redirected to /login.
I initialize my authStore in my default layout
How do I fix it so the middleware gets executed after the store is fully initialized?
