opnform/client/middleware/check-auth.global.js

6 lines
165 B
JavaScript

export default defineNuxtRouteMiddleware((to, from) => {
const authStore = useAuthStore()
authStore.loadTokenFromCookie()
authStore.fetchUserIfNotFetched()
})