adjusted AuthGuard for BehaviorSubject in AccountService

This commit is contained in:
2020-07-21 15:20:16 +02:00
parent 410d3aa622
commit 7eb77671a2
2 changed files with 3 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
import { Auth.Guard } from './auth.guard'; import { AuthGuard } from './auth.guard';
describe('Auth.Guard', () => { describe('Auth.Guard', () => {
it('should create an instance', () => { it('should create an instance', () => {
expect(new Auth.Guard()).toBeTruthy(); expect(new AuthGuard()).toBeTruthy();
}); });
}); });

View File

@@ -8,7 +8,7 @@ export class AuthGuard implements CanActivate {
private accountService: AccountService) { } private accountService: AccountService) { }
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean { canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {
const user = this.accountService.userName; const user = this.accountService.userValue;
if (user) { if (user) {
return true; return true;