There is a few possibilities:
Make sure you are using Pinia/Persistedstate, so when you refresh your page, the store is not getting flushed. this plugin keeps your State data in localstorage/cookie so it won't be removed after refresh.
really depends to your authentication but you have to make sure your access token is always fresh. so start your middleware with userStore.validateToken()
and return the result of it. so you can make some condition over your function retuns.
you did use await
so it should be all good as far as validateToken is doing his job.
you added global
to auth.global.ts
so it's not really needed to definePageMeta
on each page. the global
means that this middleware is running in all of your pages.