auth0 / angular-jwt

Library to help you work with JWTs on AngularJS
MIT License
0 stars 1 forks source link

undefined for authResult when passed into auth0.parseHash #163

Closed martynbiz closed 4 years ago

martynbiz commented 7 years ago

I'm seeing undefined for authResult after authenticating by Auth0

Below is my callback component:

import { Component } from '@angular/core';
import { AuthService } from '../auth.service';

@Component({
  template: ``
})
export class CallbackComponent {

  constructor(private authService: AuthService) {
    this.authService.handleAuth();
  }
}

Below is my AuthService handleAuth() method:

handleAuth() {
    // When Auth0 hash parsed, get profile
    this.auth0.parseHash((err, authResult) => {
      console.error(authResult); // responds "undefined"
      if (authResult && authResult.accessToken && authResult.idToken) {
        window.location.hash = '';
        this._getProfile(authResult);
        this.router.navigate(['/']);
      } else if (err) {
        this.router.navigate(['/']);
        console.error(`Error: ${err.error}`); // responds "Error: invalid_token"
      }
    });
  }

Any idea why this might be happening? How can I further debug this?

lcborn4 commented 7 years ago

I'm having this issue too. However, my callback isn't working. My handleAuthentication function is called from the app.component.ts and also from callback component.

yuvalsuede commented 6 years ago

same issue. any luck?

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you have not received a response for our team (apologies for the delay) and this is still a blocker, please reply with additional information or just a ping. Thank you for your contribution! 🙇‍♂️