We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9e2175f commit a5cbadaCopy full SHA for a5cbada
templates/app/client/components/auth(auth)/auth-guard.service.js
@@ -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