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 {} }