Closed sondr closed 6 years ago
I agree. Something like that could be a good idea. Let the handler take a look at the time remaining and then pick it up again.
Regardless, such a long timeout is a strange thing to do combined with refresh tokens and has no priority for me personally. But a PR would be more than welcome!
setTimout gets called right away if timeout exceeds int32 max value(2147483647).
In authService.js:
Change suggestion:
this.timeoutID = PLATFORM.global.setTimeout(expiredTokenHandler, ttl);
Tothis.timeoutID = PLATFORM.global.setTimeout(expiredTokenHandler, Math.min(ttl, Math.pow(2, 31) - 1));
Or throw an error if access token lifetime is too long.