From 4d2545025dfa11caf1e7260f042540f8aa10a139 Mon Sep 17 00:00:00 2001
From: andrej romanov <50377758+auumgn@users.noreply.github.com>
Date: Thu, 19 Mar 2026 18:15:06 +0200
Subject: [PATCH] PD-5144 disable authorize access button on click
---
.../form-authorize.component.html | 1 +
.../form-authorize/form-authorize.component.ts | 17 ++++++++++++++---
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/src/app/authorize/components/form-authorize/form-authorize.component.html b/src/app/authorize/components/form-authorize/form-authorize.component.html
index 10d7449735..9a5464171a 100644
--- a/src/app/authorize/components/form-authorize/form-authorize.component.html
+++ b/src/app/authorize/components/form-authorize/form-authorize.component.html
@@ -133,6 +133,7 @@
i18n="@@authorize.authorize"
(click)="authorize()"
id="authorize-button"
+ [disabled]="loadingAuthorizeEndpoint"
>
Authorize access
diff --git a/src/app/authorize/components/form-authorize/form-authorize.component.ts b/src/app/authorize/components/form-authorize/form-authorize.component.ts
index 2a2c4556a1..8063db96c9 100644
--- a/src/app/authorize/components/form-authorize/form-authorize.component.ts
+++ b/src/app/authorize/components/form-authorize/form-authorize.component.ts
@@ -16,6 +16,7 @@ import {
takeUntil,
switchMap,
tap,
+ finalize,
} from 'rxjs/operators'
import { PlatformInfo, PlatformInfoService } from 'src/app/cdk/platform-info'
import { WINDOW } from 'src/app/cdk/window'
@@ -171,13 +172,23 @@ export class FormAuthorizeComponent implements OnInit, OnDestroy {
if (useAuthServerFlag === true) {
this._oauth
.authorizeOnAuthServer(this.oauthRequest, value)
+ .pipe(
+ take(1),
+ finalize(() => (this.loadingAuthorizeEndpoint = false))
+ )
.subscribe((redirectUrl) => {
this.redirectUrl.next(redirectUrl)
})
} else {
- this._oauth.authorize(value).subscribe((data) => {
- this.redirectUrl.next(data.redirectUrl)
- })
+ this._oauth
+ .authorize(value)
+ .pipe(
+ take(1),
+ finalize(() => (this.loadingAuthorizeEndpoint = false))
+ )
+ .subscribe((data) => {
+ this.redirectUrl.next(data.redirectUrl)
+ })
}
})
)