OAuthProvider has an in-memory cache that is populated when a token response is received from server or parsed from file cache. The intention of the startExpiryTimer function in OAuthProvider is to expire/delete the cached in-memory token by taking into account the value of expires_in from in the response back from oauth server.
Expected Behavior
Token is evicted from in-memory cache once it expires.
Current Behavior
Token is evicted from in-memory cache on the next tick (after receiving response from server) as expiry is not computed and populated on the token, which results in validityPeriod to be NaN and causes the setTimeout to execute immediately.
OAuthProvider
has an in-memory cache that is populated when a token response is received from server or parsed from file cache. The intention of thestartExpiryTimer
function inOAuthProvider
is to expire/delete the cached in-memory token by taking into account the value ofexpires_in
from in the response back from oauth server.Expected Behavior
Token is evicted from in-memory cache once it expires.
Current Behavior
Token is evicted from in-memory cache on the next tick (after receiving response from server) as
expiry
is not computed and populated on thetoken
, which results invalidityPeriod
to beNaN
and causes the setTimeout to execute immediately.