feat: autenticação mockada com cookie

This commit is contained in:
Junior
2026-03-14 10:34:51 -03:00
parent ccaf29f229
commit a78b9eb314
2 changed files with 45 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
export default defineNuxtRouteMiddleware((to) => {
const { isAuthenticated } = useAuth()
if (!isAuthenticated.value && to.path !== '/login') {
return navigateTo('/login')
}
if (isAuthenticated.value && to.path === '/login') {
return navigateTo('/')
}
})