Skip to content

clearHashAfterLogin triggers even with silentRefresh #277

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Shadowlauch opened this issue Mar 29, 2018 · 2 comments
Closed

clearHashAfterLogin triggers even with silentRefresh #277

Shadowlauch opened this issue Mar 29, 2018 · 2 comments

Comments

@Shadowlauch
Copy link

The clearHashAfterLogin triggers even in the event of a silentRefresh, which if you are using the HashLocationStrategy actually resets the route and redirects the user to the main page of your application every time the app does a silentRefresh in the background.

@ngraziano
Copy link

Personally I use a workaround, I set clearHashAfterLogin=false after successful login.

this.oauthService.tryLogin({});
this.oauthService.events.
  filter((e) => e.type === 'token_received').flatMap(
    () => {
      const claims = this.oauthService.getIdentityClaims();
      if (claims) {
        // to prevent problem with silent refresh
        // this generate a redirect to home page.
        this.oauthService.clearHashAfterLogin = false;
      }
});

@manfredsteyer
Copy link
Owner

Thanks, the next version will solve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants