Skip to content
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

Premature Token Expiration #24

Open
jheinnic opened this issue Sep 24, 2017 · 0 comments
Open

Premature Token Expiration #24

jheinnic opened this issue Sep 24, 2017 · 0 comments

Comments

@jheinnic
Copy link

Working on trying to integrate the Observable signal sources I've bumped into a bug that's causing my sessions to get closed down right after returning from login.

The problem seems to be in the service handling code that is attempting to use setTimeout( ) in order to schedule a callback to pushTokenExpired( ) at the calculated expiration time. The calculated time seems to be correct, but instead of passing a reference to pushTokenExpired for future callback, the code is calling pushTokenExpired() and scheduling some behavior for whatever it returns.

`this.tokenTimeoutHandle` = setTimeout(this.pushTokenExpired(), expiresIn * 1000);

All that pushTokenExpired() does is fire one of the expiration observables, so I'm reasonably certain that calling it instead of passing it as a reference is a mistake and the intended logic is:

`this.tokenTimeoutHandle` = setTimeout(this.pushTokenExpired, expiresIn * 1000);

A workaround for the moment could be to just ignore the observables for token expiration. The Observables that fire on successful login are separate from those that manage expiration, so I can just disregard the expiration signals for now, but it would be better if they just behaved correctly.

ebondu added a commit that referenced this issue Sep 24, 2017
Premature token expiration on login (Issue #24)
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

1 participant