Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a5cbada

Browse filesBrowse files
committed
feat(client): add auth-guard service
1 parent 9e2175f commit a5cbada
Copy full SHA for a5cbada

File tree

1 file changed

+16
-0
lines changed
Filter options

1 file changed

+16
-0
lines changed
+16Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.