diff options
| author | Danijel Andjelkovic <adanijel99@gmail.com> | 2022-03-07 18:29:12 +0100 |
|---|---|---|
| committer | Danijel Andjelkovic <adanijel99@gmail.com> | 2022-03-07 18:29:12 +0100 |
| commit | c59ff03b96d7b638623c254dfe8477055aeb2a35 (patch) | |
| tree | 933ffdbf0e0d4300424d73c11bbcc8156851a71c /frontend/src/app/auth-guard.service.ts | |
| parent | 9b925712cbdedacdf8af947e929ca3975b56e3fa (diff) | |
| parent | cd2188997ff4cbcce83e3cada3fc220375ebc78e (diff) | |
Merge branch 'frontendLoginRegister' of http://gitlab.pmf.kg.ac.rs/igrannonica/neuronstellar into frontend
# Conflicts:
# frontend/package-lock.json
# frontend/package.json
Diffstat (limited to 'frontend/src/app/auth-guard.service.ts')
| -rw-r--r-- | frontend/src/app/auth-guard.service.ts | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/frontend/src/app/auth-guard.service.ts b/frontend/src/app/auth-guard.service.ts deleted file mode 100644 index b6d3678d..00000000 --- a/frontend/src/app/auth-guard.service.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Injectable } from '@angular/core'; -import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot, UrlTree } from '@angular/router'; -import { Observable } from 'rxjs'; -import { AuthService } from './auth.service'; - - -@Injectable({ - providedIn: 'root' -}) -export class AuthGuardService implements CanActivate { - - constructor(private auth: AuthService, private router: Router) { } - - canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean | UrlTree | Observable<boolean | UrlTree> | Promise<boolean | UrlTree> { - if (this.auth.isAuthenticated()) { - return true; - } - this.router.navigate(['login']); - return false; - } -} |
