From 23aa16622a9107a5ea288041374e817510ba7035 Mon Sep 17 00:00:00 2001 From: sergeyteleshev Date: Mon, 8 Jul 2024 09:53:43 +0200 Subject: [PATCH 1/3] CB-5357 resolves auth dialog on successful login (removes no license notification bug on login) --- .../packages/plugin-authentication/src/Dialog/AuthDialog.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 {} } From 08bbf42622e0c5b31e311c56dee1a7ca9ae712d0 Mon Sep 17 00:00:00 2001 From: sergeyteleshev Date: Thu, 11 Jul 2024 15:02:04 +0200 Subject: [PATCH 2/3] CB-5357 fix: do not show 2 notifications --- .../plugin-authentication/src/AuthenticationService.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/webapp/packages/plugin-authentication/src/AuthenticationService.ts b/webapp/packages/plugin-authentication/src/AuthenticationService.ts index 2af95402b6..0b1dbeccb4 100644 --- a/webapp/packages/plugin-authentication/src/AuthenticationService.ts +++ b/webapp/packages/plugin-authentication/src/AuthenticationService.ts @@ -131,11 +131,6 @@ export class AuthenticationService extends Bootstrap { } private async auth(persistent: boolean, options: IAuthOptions) { - if (this.authPromise) { - await this.waitAuth(); - return; - } - const contexts = await this.onLogin.execute('before'); if (ExecutorInterrupter.isInterrupted(contexts)) { @@ -161,6 +156,11 @@ export class AuthenticationService extends Bootstrap { } } + if (this.authPromise) { + await this.waitAuth(); + return; + } + this.authPromise = this.authDialogService .showLoginForm(persistent, options) .then(async state => { From baaa36b4ab2855dd5dd1802e030c9d46b8597970 Mon Sep 17 00:00:00 2001 From: sergeyteleshev Date: Fri, 12 Jul 2024 13:09:51 +0200 Subject: [PATCH 3/3] CB-5357 reverts authPromise logic --- .../plugin-authentication/src/AuthenticationService.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webapp/packages/plugin-authentication/src/AuthenticationService.ts b/webapp/packages/plugin-authentication/src/AuthenticationService.ts index 0b1dbeccb4..0373168ed7 100644 --- a/webapp/packages/plugin-authentication/src/AuthenticationService.ts +++ b/webapp/packages/plugin-authentication/src/AuthenticationService.ts @@ -131,6 +131,11 @@ export class AuthenticationService extends Bootstrap { } private async auth(persistent: boolean, options: IAuthOptions) { + if (this.authPromise) { + await this.waitAuth(); + return; + } + const contexts = await this.onLogin.execute('before'); if (ExecutorInterrupter.isInterrupted(contexts)) {