opnform-host-nginx/client/middleware/auth.js

9 lines
207 B
JavaScript
Raw Normal View History

export default defineNuxtRouteMiddleware((to) => {
2023-12-14 16:53:05 +01:00
const authStore = useAuthStore()
if (!authStore.check) {
useCookie("intended_url").value = to.path
return navigateTo({ name: "login" })
2023-12-14 16:53:05 +01:00
}
})