diff --git a/lib/credentials.js b/lib/credentials.js index 87bcaa4..ec811d4 100644 --- a/lib/credentials.js +++ b/lib/credentials.js @@ -153,7 +153,8 @@ class Credentials { var token = this.token; if (token && token.expiration) { - return new Date(Date.now() - 5000) > token.expiration; + //get new token 5 min before expiration + return new Date(Date.now() + 300000) > token.expiration; } else { return true; }