Skip to content
Snippets Groups Projects
Commit 2bcd60df authored by Hamza HRAMCHI's avatar Hamza HRAMCHI
Browse files

FIX #17590 TIME 0:15 enable/disable menu: check if auth is failed

parent b8279c30
Branches
Tags
No related merge requests found
......@@ -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');
......
......@@ -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) {
......
......@@ -18,6 +18,7 @@ export class AuthService {
coreUrl: string = '';
user: any = {};
signatureRoles: any[] = [];
authFailed: boolean = false;
constructor(public http: HttpClient,
private router: Router,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment