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);