I have followed the angular 2 quickstart guide, but no matter what, on page refresh/new tab opened for the angular app, the user is forced to click Login again. Auth0 Angular SDK Quickstarts: Login
I have added localhost and port number to the Allowed Web Origins, but in the handleAuthenticationMethod the authResult is always null, so the user is forced to Click Login, which redirects them to the home page, not an ideal user experience.
this.auth0.parseHash((err, authResult) => {
if (authResult && authResult.accessToken && authResult.idToken) {
this.localLogin(authResult);
this.router.navigate([‘/dashboard’]);
} else if (err) {
this.router.navigate([‘/dashboard’]);
console.log(err);
alert(Error: ${err.error}. Check the console for further details.);
}
});
How can I fix this? Ideally on new page open it should automatically login, if they have previously logged in.