You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
assert(this.ttl !== 0, 'token.ttl must be not be 0');
assert(this.ttl, 'token.ttl must exist');
assert(this.ttl >= -1, 'token.ttl must be >= -1');
var now = Date.now();
var created = this.created.getTime();
var elapsedSeconds = (now - created) / 1000;
var secondsToLive = this.ttl;
var isValid = elapsedSeconds < secondsToLive; <======= already false
In client side, I call the login with { email:xxxx, password:yyyy, ttl:-1 } .
So that i added below code into LB access-token.js var isValid = elapsedSeconds < secondsToLive; if (this.ttl >= -1) { isValid = true;} <===== add by @josephlaw
@josephlaw, are you expecting ttl = -1 to be unlimited?
After taking a deeper dive into our code, it appears as though -1 is a valid ttl value that invalidates the access-token. I believe this is actually by design.
Activity
richardpringle commentedon Jul 5, 2016
Hey @josephlaw, I'm not quite sure I understand the context here. How can I reproduce this?
By default, ttl is 1209600 (which is obviously greater than -1) and you can login and logout no problem...
josephlaw commentedon Jul 6, 2016
In client side, I call the login with { email:xxxx, password:yyyy, ttl:-1 } .
So that i added below code into LB access-token.js
var isValid = elapsedSeconds < secondsToLive;if (this.ttl >= -1) { isValid = true;} <===== add by @josephlawrichardpringle commentedon Jul 6, 2016
@josephlaw, are you expecting
ttl = -1to be unlimited?After taking a deeper dive into our code, it appears as though
-1is a valid ttl value that invalidates the access-token. I believe this is actually by design.@bajtos will have to confirm.
josephlaw commentedon Jul 7, 2016
yes, I expect it will not expire.
richardpringle commentedon Jul 7, 2016
@josephlaw
There is a pull request for the desired feature: #1797
I am closing this issue since the problem has already been addressed in the PR, please leave any further comments on there.