-
Notifications
You must be signed in to change notification settings - Fork 26
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
Session refresh check issue #59
Comments
Shouldn't the Or, should the |
I see the problem. The Alternatively we could go around the problem on the frontend by using a locale date to compare with after a successful |
You actually mean time here or client side in general? But we need the time anyway to know how far we are along the threshold? |
Client side time. So far we rely only on what the server give us for beginning/issued and end/expires and compare with client time to check for refresh or what not, which is fine. I'll come up with something, no worries. |
Awesome. I openend an issue at the superlogin: colinskow/superlogin#162. I'll try to look into superlogin's code what would need to happen to add that refreshed field. |
I've opened a pull request at superlogin: colinskow/superlogin#163 |
What's the status on this? |
This fix seems to work, we've been using a fork with this fix for a while. This does however also requires a fix in superlogin, so we're also running a fork of superlogin. Superlogin-client will fall back to how it used to work if needed, so you can use this without an updated superlogin. Releasing it sounds like a good idea. |
We're running into the issue that after a while user get into a loop where superlogin-client keeps refreshing the session. We think there is something wrong with the
checkRefresh()
logic.We hope the following illustration explains the issue.
The user logged in a while ago (on the issued date), he now is beyond
refreshThreshold
, in this case 30% of total potential session lifetime (issued till expires). (refreshThreshold: 0.3
).The session is refreshed, the
issued
date stays the same but theexpires
moves up.After that refresh the current date is still beyond the refresh threshold, since this is calculated from the issued date until the expires date. This means that when
checkRefresh
is called again it will have to refresh again.We noticed the issue because we perform a request after a successful refresh (when the refreshed event is triggered), that new request would trigger another refresh, triggering an infinite loop.
@colinskow, what do you think?
The text was updated successfully, but these errors were encountered: