I have a simple page that subscribes to an observable. The entire page hangs and it does not render. What is wrong here?
ngOnInit () {
const query = this.activatedRoute.snapshot.queryParams;
if (!query.code) {
this.router.navigate(['/auth/login']);
} else {
this.checkGoogleCodeAndRedirect(query);
}
}
private checkGoogleCodeAndRedirect (query: { [K: string]: string }) {
this.authStateService.authenticateWithGoogle(query.code).subscribe(
(x) => {
if (query.state) {
return;
}
return this.router.navigate(['/']);
},
(error) => {
return this.router.navigate(['/auth/login']);
},
);
}