From 43f5a1fbafaeb2752f9bd3ae80b153729dc548ab Mon Sep 17 00:00:00 2001 From: Manuel Abascal Date: Tue, 23 Jan 2024 22:32:48 +0200 Subject: [PATCH 1/2] Fixed Unhandled login error (#359) --- .../src/app/shared/components/auth/login/login.component.html | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/app/shared/components/auth/login/login.component.html b/frontend/src/app/shared/components/auth/login/login.component.html index dee7a5b42..46ff654d6 100644 --- a/frontend/src/app/shared/components/auth/login/login.component.html +++ b/frontend/src/app/shared/components/auth/login/login.component.html @@ -31,6 +31,7 @@ From d4ad0f731e5742b3d5c10b629066acdfc7dcdbe7 Mon Sep 17 00:00:00 2001 From: Manuel Abascal Date: Wed, 24 Jan 2024 18:24:33 +0200 Subject: [PATCH 2/2] Fixed User management module allows an action that causes UTMStack hanging when login. (#360) --- .../user-update/user-management-update.component.html | 6 +++++- .../app/shared/components/auth/login/login.component.html | 2 +- .../app/shared/components/auth/login/login.component.ts | 8 ++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/admin/user/user-update/user-management-update.component.html b/frontend/src/app/admin/user/user-update/user-management-update.component.html index da2a77e4e..940c3cdd3 100644 --- a/frontend/src/app/admin/user/user-update/user-management-update.component.html +++ b/frontend/src/app/admin/user/user-update/user-management-update.component.html @@ -77,9 +77,13 @@
- + + This field is required. You must select a role. +
diff --git a/frontend/src/app/shared/components/auth/login/login.component.html b/frontend/src/app/shared/components/auth/login/login.component.html index 46ff654d6..495eaf75c 100644 --- a/frontend/src/app/shared/components/auth/login/login.component.html +++ b/frontend/src/app/shared/components/auth/login/login.component.html @@ -68,7 +68,7 @@ -
+
diff --git a/frontend/src/app/shared/components/auth/login/login.component.ts b/frontend/src/app/shared/components/auth/login/login.component.ts index 8b6d2b8fc..ecce7d487 100644 --- a/frontend/src/app/shared/components/auth/login/login.component.ts +++ b/frontend/src/app/shared/components/auth/login/login.component.ts @@ -10,7 +10,7 @@ import {LoginService} from '../../../../core/login/login.service'; import {UtmToastService} from '../../../alert/utm-toast.service'; import {MenuBehavior} from '../../../behaviors/menu.behavior'; import {ThemeChangeBehavior} from '../../../behaviors/theme-change.behavior'; -import {ADMIN_DEFAULT_EMAIL, ADMIN_ROLE, DEMO_URL} from '../../../constants/global.constant'; +import {ADMIN_DEFAULT_EMAIL, ADMIN_ROLE, DEMO_URL, USER_ROLE} from '../../../constants/global.constant'; import {stringParamToQueryParams} from '../../../util/query-params-to-filter.util'; import {PasswordResetInitComponent} from '../password-reset/init/password-reset-init.component'; @@ -27,6 +27,7 @@ export class LoginComponent implements OnInit, AfterViewInit { credentials: any; formLogin: FormGroup; logged = false; + roles = [ADMIN_ROLE, USER_ROLE]; startLogin = false; isInDemo: boolean; loadingAuth = true; @@ -171,11 +172,14 @@ export class LoginComponent implements OnInit, AfterViewInit { ? '/getting-started' : '/dashboard/overview'; this.router.navigate([redirectTo]) .then(() => this.spinner.hide()); + } else { + this.logged = false; + this.utmToast.showError('Login error', 'User without privileges.'); } }); } - startInternalNavigation(){ + startInternalNavigation() { this.router.navigate(['/dashboard/overview']); }