Refreshing tokens on page navigation
I'm currently fighting with refreshing tokens on route navigation in a
As far as I can tell the issue is that the
I've solved the login issue by moving it to
auth.global.ts RouteMiddleware.As far as I can tell the issue is that the
login and refreshToken methods in my useAuth composable are async, but using async in defineNuxtRouteMiddleware causes the server to spit out errors such as Fetch handler error: Premature closeI've solved the login issue by moving it to
onMounted in app.vue but would like to make sure that tokens have not expired/are refreshed on page loads (I will also be refreshing the tokens on API calls)