elk/middleware/auth.ts
三咲智子 f2d125ed4e
feat: wip
2023-01-04 23:41:32 +08:00

13 lines
303 B
TypeScript

export default defineNuxtRouteMiddleware((to) => {
if (process.server)
return
if (to.path === '/signin/callback')
return
onMastoInit(() => {
if (isGuest.value)
return navigateTo(`/${currentServer.value}/public`)
if (to.path === '/')
return navigateTo('/home')
})
})