function shouldRefreshToken(expires_at, now = null) {
  if (!expires_at) {
    return true;
  }
  const currentTime = now ? 1000 * now : Date.now();
  const canRefreshTime = 1000 * (expires_at - tokenExpirationBuffer);
  return currentTime - canRefreshTime > 0;
}
// Compare times in ms to reduce chance of currentTime === canRefreshTime
Compare times in ms to reduce chance of currentTime === canRefreshTime
Compare times in ms to reduce chance of currentTime === canRefreshTime
function shouldRefreshToken(expires_at, now = null) {
  if (!expires_at) {
    return true;
  }
  const currentTime = now ? 1000 * now : Date.now();
  const canRefreshTime = 1000 * (expires_at - tokenExpirationBuffer);
  return currentTime - canRefreshTime > 0;
}
function shouldRefreshToken ( expires_at , now = null ) { if ( ! expires_at ) { return true ; } const currentTime = now ? 1000 * now : Date . now ( ) ; const canRefreshTime = 1000 * ( expires_at - tokenExpirationBuffer ) ; return currentTime - canRefreshTime > 0 ; }
Compare times in ms to reduce chance of currentTime === canRefreshTime
Compare times in ms to reduce chance of currentTime === canRefreshTime