Auth0 issue.
My application is re-triggering the login event after sign-out on browser refresh and having issues with user profile. I tracked it down to parseHash in the authentication service:
this.auth0.parseHash({ hash: window.location.hash }, (err, authResult) => {
...
}
which is fired with the ngrx effect:
@Effect()
init$ = defer(() => {
const userData = localStorage.getItem("user");
if (userData != null && userData != 'undefined') {
let authActionObservable = of(new Login({user: JSON.parse(userData)}));
this.authService.handleAuthentication();
return authActionObservable;
}
this.authService.handleAuthentication();
});
It seems this.auth0.parseHash is returning null for both authResult and err after page refresh but on initial login authResult is populated correctly.
Technically the login is successful and I get the tokens. I checked the whole configuration, domain etc and everything seems fine. I also tried playing around with { hash: window.location.hash }.