Skip to content
Snippets Groups Projects
Commit b043ddb9 authored by Jean-Laurent DUZANT's avatar Jean-Laurent DUZANT
Browse files

Merge branch 'fix/22565/develop' into 'develop'

[22565] TMA - Erreurs au premier chargement de la page de connexion nécessitant le rafraichissement systématique de la page de connexion

See merge request maarch/MaarchParapheur!167
parents 76003fee 874e88d8
No related branches found
No related tags found
No related merge requests found
......@@ -28,13 +28,13 @@ 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.loginMessage = data.loginMessage;
this.authService.authMode = data.connection;
......@@ -42,9 +42,9 @@ export class AuthGuard implements CanActivate {
this.authService.coreUrl = data.coreUrl;
this.authService.mailServerOnline = data.mailServerOnline;
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