fix(auth): await OAuth storage load() to fix remote OAuth races
This commit is contained in:
parent
7bd26c938e
commit
a24091484c
1 changed files with 245 additions and 133 deletions
|
|
@ -21,10 +21,13 @@ export async function getEmaIdpLoginState(
|
|||
return "expired";
|
||||
}
|
||||
|
||||
export function clearEmaIdpSession(storage: OAuthStorage, issuer: string): void {
|
||||
export async function clearEmaIdpSession(
|
||||
storage: OAuthStorage,
|
||||
issuer: string,
|
||||
): Promise<void> {
|
||||
const normalized = normalizeIdpIssuer(issuer);
|
||||
if (!normalized) return;
|
||||
storage.clearIdpSession(normalized);
|
||||
storage.clear(idpOAuthStorageKey(normalized));
|
||||
storage.clearEnterpriseManagedResourceServers();
|
||||
await storage.clearIdpSession(normalized);
|
||||
await storage.clear(idpOAuthStorageKey(normalized));
|
||||
await storage.clearEnterpriseManagedResourceServers();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue