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

6 lines
165 B
JavaScript
Raw Normal View History

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