From 956368331a58b7bd7aca3e56be9d87a0b6749a9a Mon Sep 17 00:00:00 2001 From: Thomas Wagner Date: Sat, 7 Dec 2024 13:25:31 -0500 Subject: [PATCH] fix expired check This fixes the expires check. As it was, setting expirationBuffer to a positive number caused isLoggedIn() to incorrectly throw that that JWT was expired --- src/verifier.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/verifier.ts b/src/verifier.ts index 04a4a3f..a85d27d 100644 --- a/src/verifier.ts +++ b/src/verifier.ts @@ -75,6 +75,6 @@ export class PomeriumVerifier { return false; } const currentDateInSeconds = new Date().getTime() / 1000; - return exp < (currentDateInSeconds + this.expirationBuffer) + return currentDateInSeconds < (exp + this.expirationBuffer); } }