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

@@ -37,10 +37,10 @@ export default defineEventHandler(async (event) => {
let token: string | null = null
try {
token = await client.getAccessToken('https://teams.optovia.ru', organizationId)
token = await client.getIdToken()
} catch {
try {
token = await client.getIdToken()
token = await client.getAccessToken('https://teams.optovia.ru', organizationId)
} catch {
return
}