@ntegral/lulu
Advanced tools
Comparing version 1.2.8 to 1.2.9
@@ -56,4 +56,5 @@ "use strict"; | ||
} | ||
if (this.isAuthenticated && this.decoded && !moment.unix(+this.decoded.payload.exp).isAfter(now.add(10, 'minutes'))) { | ||
if (this.isAuthenticated && this.decoded && now.isSameOrAfter(this.clock.add(60, 'seconds'))) { | ||
let result = yield this.refreshToken(this.token); | ||
console.log('refreshing token...'); | ||
resolve(result); | ||
@@ -60,0 +61,0 @@ } |
@@ -63,8 +63,14 @@ import * as request from 'request'; | ||
} | ||
if (this.isAuthenticated && this.decoded && !moment.unix(+this.decoded.payload.exp).isAfter(now.add(10,'minutes'))) { // token hasn't expired renew // | ||
if (this.isAuthenticated && this.decoded && now.isSameOrAfter(this.clock.add(60,'seconds'))) { | ||
let result = await this.refreshToken(this.token); | ||
console.log('refreshing token...'); | ||
// return result; | ||
resolve(result); | ||
} | ||
/* if (this.isAuthenticated && this.decoded && !moment.unix(+this.decoded.payload.exp).isAfter(now.add(10,'minutes'))) { // token hasn't expired renew // | ||
let result = await this.refreshToken(this.token); | ||
// console.log('using of refreshToken'); | ||
// return result; | ||
resolve(result); | ||
} | ||
} */ | ||
if (this.isAuthenticated && this.decoded && moment.unix(+this.decoded.payload.exp).isAfter(now)) { // token has expired, get a new token // | ||
@@ -71,0 +77,0 @@ let result = await this.getToken(); |
@@ -10,3 +10,3 @@ { | ||
"name": "@ntegral/lulu", | ||
"version": "1.2.8", | ||
"version": "1.2.9", | ||
"description": "Lulu Print API Client", | ||
@@ -13,0 +13,0 @@ "main": "./dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55285
1466