fix(auth): avoid cabinet redirect loop and use teams access token

This commit is contained in:
Ruslan Bakiev
2026-04-21 12:55:19 +07:00
parent 351125b51d
commit 7b4eaeeb92
2 changed files with 17 additions and 8 deletions

View File

@@ -12,8 +12,10 @@ export default defineNuxtRouteMiddleware(async (to) => {
}
const { loggedIn } = useAuth()
const localePath = useLocalePath()
const logtoUser = useState<Record<string, unknown> | null>('logto-user', () => null)
if (!loggedIn.value) {
return navigateTo('/sign-in')
if (!loggedIn.value && !logtoUser.value) {
return navigateTo(localePath('/sign-in'))
}
})