410/5000
Hello. I am using Authorize method to login and I have a function that handles the return of login in a callback component. The problem is that when the application returns it identifies the return as an unknown application path and I get a page error not found. Instead of receiving AuthResult for the callback page to handle this result, it interprets the return as part of the url.
My handleLoginCallback function:
handleLoginCallback() {
this._auth0.parseHash((err, authResult) => {
console.log('Auth Result:', JSON.stringify(authResult))
if (authResult && authResult.accessToken) {
window.location.hash = '';
localStorage.setItem('accessToken', authResult.accessToken);
this.getUserInfo(authResult);
} else if (err) {
this.router.navigate(['/']);
console.error(`Error authenticating: ${err.error}`);
}
});
}
login:
login(redirect?: string) {
const _redirect = redirect ? redirect : this.router.url;
localStorage.setItem(‘auth_redirect’, _redirect);
this._auth0.authorize();
}