Skip to content

Instantly share code, notes, and snippets.

@GerritRiesch94
Created April 13, 2023 13:00
Show Gist options
  • Save GerritRiesch94/2f3506da7bb8c5b1f92a907ad482871f to your computer and use it in GitHub Desktop.
Save GerritRiesch94/2f3506da7bb8c5b1f92a907ad482871f to your computer and use it in GitHub Desktop.
AuthGuard old
@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