Skip to content

Commit a5cbada

Browse files
committed
feat(client): add auth-guard service
1 parent 9e2175f commit a5cbada

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { Injectable } from '@angular/core';
2+
import { CanActivate } from '@angular/router';
3+
4+
import { AuthService } from './auth.service';
5+
6+
@Injectable()
7+
export class AuthGuard implements CanActivate {
8+
static parameters = [AuthService];
9+
constructor(authService: AuthService) {
10+
this.authService = authService;
11+
}
12+
13+
canActivate() {
14+
return this.authService.isLoggedIn();
15+
}
16+
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy