diff --git a/src/frontend/app/login/login.component.ts b/src/frontend/app/login/login.component.ts index 850ca4bc2c21116645d7bcf5ad051850780e73f0..54400abad243212b37ee349907ffb1e096698e7d 100644 --- a/src/frontend/app/login/login.component.ts +++ b/src/frontend/app/login/login.component.ts @@ -86,7 +86,6 @@ export class LoginComponent implements OnInit, AfterViewInit { this.showForm = false; this.authService.saveTokens(data.headers.get('Token'), data.headers.get('Refresh-Token')); this.authService.setUser({}); - if (this.authService.getCachedUrl()) { this.router.navigateByUrl(this.authService.getCachedUrl()); this.authService.cleanCachedUrl(); @@ -97,6 +96,7 @@ export class LoginComponent implements OnInit, AfterViewInit { }), catchError((err: any) => { this.loading = false; + this.authService.authFailed = true; if (err.status === 401 && ['kerberos', 'x509', 'azure_saml'].indexOf(this.authService.authMode) === -1) { this.notificationService.error('lang.wrongLoginPassword'); loading.dismiss(); @@ -110,8 +110,7 @@ export class LoginComponent implements OnInit, AfterViewInit { return of(false); }) - ) - .subscribe(); + ).subscribe(); } else { loading.dismiss(); this.notificationService.error('lang.requiredLoginPassword'); diff --git a/src/frontend/app/service/auth.guard.ts b/src/frontend/app/service/auth.guard.ts index 50e552e87166f5b73e5e0f2d42c8da34c7529dec..4d9de543d5f28db53aa0bfbb66c6961d8a582b23 100644 --- a/src/frontend/app/service/auth.guard.ts +++ b/src/frontend/app/service/auth.guard.ts @@ -45,8 +45,10 @@ export class AuthGuard implements CanActivate { return true; } } else { - this.menu.enable(true, 'left-menu'); - this.menu.enable(false, 'right-menu'); + if (!this.authService.authFailed) { + this.menu.enable(true, 'left-menu'); + this.menu.enable(false, 'right-menu'); + } let tokenInfo = this.authService.getToken(); if (tokenInfo !== null) { if (this.authService.user.id === undefined) { diff --git a/src/frontend/app/service/auth.service.ts b/src/frontend/app/service/auth.service.ts index f0468c15e105bde3d6ba2159f0cadc74b343fe23..913005fa591f1205624c977784451d4bb3a46138 100755 --- a/src/frontend/app/service/auth.service.ts +++ b/src/frontend/app/service/auth.service.ts @@ -18,6 +18,7 @@ export class AuthService { coreUrl: string = ''; user: any = {}; signatureRoles: any[] = []; + authFailed: boolean = false; constructor(public http: HttpClient, private router: Router,