1
0
elk/middleware/auth.ts
2022-12-04 20:05:11 +00:00

7 lines
190 B
TypeScript

export default defineNuxtRouteMiddleware((to) => {
if (!currentUser.value)
return navigateTo(`/${currentServer.value}/public`)
if (to.path === '/')
return navigateTo('/home')
})