79545327

Date: 2025-03-31 00:51:23
Score: 0.5
Natty:
Report link

There is a few possibilities:

  1. 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.

  2. 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.

Reasons:
  • Blacklisted phrase (1): this plugin
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Abolfazl Ghaemi