!50 判断jwt是否过期,应该是过期时间在当前时间之前才是过期

Merge pull request !50 from MaxKeyTop/cherry-pick-1735891491
需要进一步验证
This commit is contained in:
MaxKeyTop 2025-01-03 08:09:09 +00:00 committed by Gitee
commit c44715c6ee
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -122,7 +122,7 @@ public class AuthJwtService {
if(StringUtils.isNotBlank(authToken) && authToken.length() > 20) {
try {
JWTClaimsSet claims = resolve(authToken);
boolean isExpiration = claims.getExpirationTime().after(DateTime.now().toDate());
boolean isExpiration = claims.getExpirationTime().before(DateTime.now().toDate());
boolean isVerify = hmac512Service.verify(authToken);
_logger.debug("JWT Validate {} " , isVerify && isExpiration);