Skip to content

Instantly share code, notes, and snippets.

@arturovt
Created May 21, 2019 18:02
Show Gist options
  • Save arturovt/44723055f9cd7aa4b24812b9e6414042 to your computer and use it in GitHub Desktop.
Save arturovt/44723055f9cd7aa4b24812b9e6414042 to your computer and use it in GitHub Desktop.
@Injectable({ providedIn: 'root' })
export class AuthGuard implements CanActivate {
constructor(private store: Store) {}
public canActivate(): boolean {
const { isAuthenticated } = this.store.selectSnapshot<AuthStateModel>(AuthState);
return isAuthenticated;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment