2022-12-05 04:56:33 +09:00
|
|
|
export default defineNuxtRouteMiddleware((to) => {
|
2022-12-18 01:55:29 +09:00
|
|
|
if (process.server)
|
|
|
|
return
|
2022-12-26 17:34:30 +09:00
|
|
|
if (to.path === '/signin/callback')
|
|
|
|
return
|
|
|
|
|
2023-01-03 18:53:31 +09:00
|
|
|
onMastoInit(() => {
|
|
|
|
if (!currentUser.value)
|
2023-01-08 06:35:42 +09:00
|
|
|
return navigateTo(`/${currentServer.value}/public/local`)
|
2023-01-03 18:53:31 +09:00
|
|
|
if (to.path === '/')
|
|
|
|
return navigateTo('/home')
|
|
|
|
})
|
2022-11-15 22:54:13 +09:00
|
|
|
})
|