fix(auth): avoid cabinet redirect loop and use teams access token
This commit is contained in:
@@ -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'))
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user