From fb9cd47bedb46621a3ef48343b54989fcc4f9d7e Mon Sep 17 00:00:00 2001 From: sergeyteleshev Date: Sun, 14 Jul 2024 16:42:24 +0200 Subject: [PATCH] CB-5357 Expiring license notification is not shown after login (#2767) * CB-5357 resolves auth dialog on successful login (removes no license notification bug on login) * CB-5357 fix: do not show 2 notifications * CB-5357 reverts authPromise logic --------- Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com> --- .../plugin-authentication/src/AuthenticationService.ts | 5 +++++ .../packages/plugin-authentication/src/Dialog/AuthDialog.tsx | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/webapp/packages/plugin-authentication/src/AuthenticationService.ts b/webapp/packages/plugin-authentication/src/AuthenticationService.ts index 2af95402b6..0373168ed7 100644 --- a/webapp/packages/plugin-authentication/src/AuthenticationService.ts +++ b/webapp/packages/plugin-authentication/src/AuthenticationService.ts @@ -161,6 +161,11 @@ export class AuthenticationService extends Bootstrap { } } + if (this.authPromise) { + await this.waitAuth(); + return; + } + this.authPromise = this.authDialogService .showLoginForm(persistent, options) .then(async state => { diff --git a/webapp/packages/plugin-authentication/src/Dialog/AuthDialog.tsx b/webapp/packages/plugin-authentication/src/Dialog/AuthDialog.tsx index 6f4aaff3ce..73f0de315c 100644 --- a/webapp/packages/plugin-authentication/src/Dialog/AuthDialog.tsx +++ b/webapp/packages/plugin-authentication/src/Dialog/AuthDialog.tsx @@ -42,6 +42,7 @@ export const AuthDialog: DialogComponent = observer(function payload: { providerId, configurationId, linkUser = false, accessRequest = false }, options, rejectDialog, + resolveDialog, }) { const styles = useS(style); const dialogData = useAuthDialogState(accessRequest, providerId, configurationId); @@ -89,7 +90,7 @@ export const AuthDialog: DialogComponent = observer(function try { await dialogData.login(linkUser, provider, configuration); - rejectDialog(); + resolveDialog(); } catch {} }