This commit is contained in:
2025-12-26 01:44:16 +06:00
parent 461cbc6f83
commit 3b3f6b6e40
2 changed files with 4 additions and 2 deletions

View File

@@ -6,7 +6,9 @@ export default defineNuxtRouteMiddleware(async (to, from) => {
if (!me.value) {
try {
setMe(await chadApi('/me', { method: 'GET' }))
return navigateTo({ name: 'Index' })
if (to.meta.auth !== false)
return navigateTo({ name: 'Index' })
}
catch {
if (to.meta.auth !== 'guest') {