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

(cherry picked commit from <gitee.com//dromara/MaxKey/commit/4a2ec5c21ebe320bc5b35f5d3c1f5e880394e29b>
This commit is contained in:
zwj
2025-01-03 07:36:06 +00:00
committed by MaxKeyTop
parent ff6e2d078b
commit a6faa8cea7

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);