From c5e137241ca50c0d9c093bcb14bfbfc26cd62690 Mon Sep 17 00:00:00 2001 From: Wroud Date: Wed, 24 Nov 2021 11:19:28 +0300 Subject: [PATCH] fix(core-authentication): CB-1448 remove resolved authentication dialogue from cache --- .../packages/core-authentication/src/AuthInfoService.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/webapp/packages/core-authentication/src/AuthInfoService.ts b/webapp/packages/core-authentication/src/AuthInfoService.ts index af791b674e..bb916ebb74 100644 --- a/webapp/packages/core-authentication/src/AuthInfoService.ts +++ b/webapp/packages/core-authentication/src/AuthInfoService.ts @@ -78,7 +78,7 @@ export class AuthInfoService { await this.userInfoResource.logout(); } - private ssoAuth(providerId: string, configuration: AuthProviderConfiguration): Promise { + private async ssoAuth(providerId: string, configuration: AuthProviderConfiguration): Promise { const active = this.activeSSO.get(configuration.id); if (active) { @@ -107,7 +107,11 @@ export class AuthInfoService { }; this.activeSSO.set(configuration.id, active); - return active.promise; + try { + return await active.promise; + } finally { + this.activeSSO.delete(configuration.id); + } } return Promise.resolve(null);