Hi Dan
I made a few changes, compared to the quick start:
- Removed the
handleAuthCallback()from the auth service constructor. ThehandleAuthCallback()is placed in thengOnInit()on the Auth0 callback url, in our case /auth. see below
constructor(private auth0Service: Auth0SpaService) { }
ngOnInit() {
this.auth0Service.handleAuthCallback();
}
- In the
handleAuthCallback()we usethis.router.navigateByUrl(targetRoute), wherenavigateByUrlis different from the quick guide
In order to reproduce. The problem seems to occur when you refresh the browser, when you are on the Auth0 callback url from a successful login. It is easier to reproduce If you add a delay on the ngOnInit above, then you have time to press the refresh button before redirected.
At this moment, the error is only reported from Chrome 79.0.3945
Please let me know if any other info is needed.
Just added a screenshot of the stacktrace when the error occur on refresh browser
Thanks in advance
