Yuvals
Yuvals

Reputation: 3266

Auth0 Angular parseHash returns undefined

I am using auth0-jwt to handle authentication:

this.auth0.parseHash((err, authResult) => {
  if (authResult && authResult.accessToken && authResult.idToken) {
    window.location.hash = '';
    this.setSession(authResult);
    this.router.navigate(['/']);
  } else if (err) {
    this.router.navigate(['/']);
  }
});

However, while window.location.hash contains authResult: #access_token=qwe&expires_in=7200&token_type=Bearer&state=zbc&id_token=xyz, auth0.parseHash returns invalid token and authResult is undefined I am using : "@auth0/angular-jwt": "^1.0.0-beta.9", "auth0-js": "^9.2.2"

Upvotes: 2

Views: 407

Answers (1)

Yuvals
Yuvals

Reputation: 3266

The problem was using wrong Domain for both application and what is defined on Auth0

Upvotes: 0

Related Questions