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
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)