10 lines
214 B
TypeScript
Raw Normal View History

2023-01-11 10:54:25 +01:00
import { useAuth } from '~/stores/auth'
export default defineNuxtRouteMiddleware((to, from) => {
const auth = useAuth()
auth.inspectToken()
if (!auth.isLogin) {
return navigateTo('/')
}
})