Created
April 13, 2023 13:00
-
-
Save GerritRiesch94/2f3506da7bb8c5b1f92a907ad482871f to your computer and use it in GitHub Desktop.
AuthGuard old
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Injectable({ | |
providedIn: 'root', | |
}) | |
export class AuthGuard implements CanActivate { | |
constructor(private authService: AuthService) {} | |
canActivate( | |
route: ActivatedRouteSnapshot, | |
state: RouterStateSnapshot | |
): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree { | |
return this.authService.isAuthenticated(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment