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

6 lines
170 B
JavaScript
Raw Normal View History

2023-12-14 15:53:05 +00:00
export default defineNuxtRouteMiddleware((to, from) => {
const authStore = useAuthStore()
authStore.loadTokenFromCookie()
useAuthStore().fetchUserIfNotFetched()
})