Skip to content
Snippets Groups Projects
Commit cf4878e0 authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FIX #22648 TIME 0:30 fix guard with authenticationInformations

parent 22d4c6ca
No related branches found
No related tags found
No related merge requests found
......@@ -28,21 +28,21 @@ export class AuthGuard implements CanActivate {
public dialog: MatDialog,
private menu: MenuController) { }
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> | boolean {
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<any> | boolean {
if (route.url.join('/') === 'login') {
if (this.authService.isAuth()) {
this.router.navigate(['/home']);
return false;
} else {
this.http.get('../rest/authenticationInformations').pipe(
return this.http.get('../rest/authenticationInformations').pipe(
map((data: any) => {
this.authService.authMode = data.connection;
this.authService.changeKey = data.changeKey;
this.authService.coreUrl = data.coreUrl;
this.localStorage.setAppSession(data.instanceId);
return true;
})
). subscribe();
return true;
);
}
} else if (!this.authService.authFailed) {
this.menu.enable(true, 'left-menu');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment