Having trouble with Auth0.
Upon sign-out and browser refresh, my application is unexpectedly triggering the login event again and encountering user profile issues. The root of the problem seems to lie in the parseHash method within the authentication service:
this.auth0.parseHash({ hash: window.location.hash }, (err, authResult) => {
...
}
This method is being called by 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();
});
After refreshing the page, it seems that parseHash is returning null values for both authResult and err, even though they are populated correctly during the initial login process.
Although I am receiving the tokens upon successful login, the issue persists. I have double-checked all configurations, domains, and settings, and everything appears to be in order. I have also experimented with different values for { hash: window.location.hash }.