Revision 51359
Added by Myrto Koukouli about 6 years ago
auth-guard.service.ts | ||
---|---|---|
12 | 12 |
private loginUrl : string = `${apiUrl}/openid_connect_login`; |
13 | 13 |
|
14 | 14 |
|
15 |
constructor(private authenticationService: AuthenticationService, private router: Router) {} |
|
15 |
constructor (private authenticationService: AuthenticationService, private router: Router) {}
|
|
16 | 16 |
|
17 |
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) { |
|
17 |
canActivate (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
|
|
18 | 18 |
|
19 |
if (this.authenticationService.getIsUserLoggedIn()) { return true; }
|
|
19 |
if ( this.authenticationService.getIsUserLoggedIn() ) { return true; }
|
|
20 | 20 |
|
21 |
if (getCookie('currentUser') != null) {return true;}
|
|
21 |
if ( getCookie('currentUser') != null ) { return true; }
|
|
22 | 22 |
|
23 | 23 |
// Store the attempted URL for redirecting |
24 | 24 |
sessionStorage.setItem("state.location",state.url); |
Also available in: Unified diff
fixed some bugs and checked update/add repository methods