From a8a02478ce522eb51c46517b4176aa0d50481676 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 28 Feb 2020 11:03:44 +0100 Subject: [PATCH] fix(auth): cache only valid results for one day --- src/auth.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/auth.ts b/src/auth.ts index 9ac6157..8720563 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -19,7 +19,7 @@ export class Authentication implements IAuthentication { const authResult = await this.authenticator.authenticate(username, password); console.log(`Auth Result for user ${username}`, authResult ? 'SUCCESS' : 'Failure'); - this.cache.set(cacheKey, authResult, 86400); // cache for one day + this.cache.set(cacheKey, authResult, authResult ? 86400 : 60); // cache for one day on success, otherwise just for 60 seconds return authResult; }