Fix warnings in TokenCache

This commit is contained in:
snobu 2020-04-06 14:59:37 +03:00
parent 7c32b2f310
commit 3314cc08b5

View file

@ -28,12 +28,16 @@ export class TokenCache {
let timeLeftInMinutes = Math.floor(timeLeft / 60);
console.log("\n");
term.bgBrightGreen.black(`Access token still good for ${timeLeftInMinutes} minutes.`);
console.log("\n");
if (timeLeft < 120) {
term.bgBrightYellow.black("Access token is expired.").bgDefaultColor("\n");
return null;
}
term.bgBrightGreen.black(`Access token still good for ${timeLeftInMinutes} minutes.`)
.bgDefaultColor("\n");
let session: Session = {
AccessToken: j.AccessToken,
ApiGatewayUri: j.ApiGatewayUri,