Skip to content

Commit

Permalink
Fixed condition to check expired token for exec auth
Browse files Browse the repository at this point in the history
Fixes #228

It also fixes the issue where if the token is valid it was regenerating every time.
  • Loading branch information
ankitabhopatkar13 authored Apr 25, 2019
1 parent 4a5b84d commit 8993516
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/exec_auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class ExecAuth implements Authenticator {
const cachedToken = this.tokenCache[user.name];
if (cachedToken) {
const date = Date.parse(cachedToken.status.expirationTimestamp);
if (date < Date.now()) {
if (date > Date.now()) {
return `Bearer ${cachedToken.status.token}`;
}
this.tokenCache[user.name] = null;
Expand Down

0 comments on commit 8993516

Please sign in to comment.