Skip to content
Snippets Groups Projects
Commit c7f564d5 authored by James Page's avatar James Page
Browse files

#46 - Validate JWT tokens with no expiry date

parent 0190a90d
Branches
Tags
1 merge request!63Resolve "Allow expiry date for JWT tokens to be the zero date"
This commit is part of merge request !63. Comments created here will be created in the context of that merge request.
......@@ -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")
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment