11 lines
273 B
TypeScript
11 lines
273 B
TypeScript
export default defineNuxtRouteMiddleware((to) => {
|
|
const auth = useAuth()
|
|
const localePath = useLocalePath()
|
|
|
|
auth.inspectToken()
|
|
|
|
if (!auth.isLogin && !String(to.name).includes('index_')) {
|
|
return navigateTo(localePath({ name: 'index' }))
|
|
}
|
|
})
|