fix(auth): stabilize header session state and retry team token errors

This commit is contained in:
Ruslan Bakiev
2026-04-21 13:50:11 +07:00
parent 7b4eaeeb92
commit e1e6993f35
4 changed files with 78 additions and 28 deletions

View File

@@ -7,7 +7,8 @@
export const useAuth = () => {
const { getToken, initTokens, idToken } = useLogtoTokens()
const me = useState<{ id?: string | null } | null>('me', () => null)
const isAuthenticated = computed(() => !!me.value?.id)
const logtoUser = useState<Record<string, unknown> | null>('logto-user', () => null)
const isAuthenticated = computed(() => !!(me.value?.id || logtoUser.value))
const loggedIn = isAuthenticated
/**