From c7f564d51c46203cc3828ba2af99a03a10b85265 Mon Sep 17 00:00:00 2001 From: James Page <james@bob.co.za> Date: Wed, 30 Apr 2025 11:47:15 +0200 Subject: [PATCH] #46 - Validate JWT tokens with no expiry date --- auth/jwt.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auth/jwt.go b/auth/jwt.go index 55824e2..65f7911 100644 --- a/auth/jwt.go +++ b/auth/jwt.go @@ -100,7 +100,7 @@ func ValidateJWT(jsonWebTokenString string, secretKey string) (JsonWebToken, err } // Validate the expiry date - if jsonWebToken.ExpiryDate.Before(date_utils.CurrentDate()) { + if !jsonWebToken.ExpiryDate.IsZero() && jsonWebToken.ExpiryDate.Before(date_utils.CurrentDate()) { return jsonWebToken, errors.Error("token has expired") } -- GitLab