提交错误修正,判断jwt是否过期,应该是过期时间在当前时间之前才是过期

用户时间 > 当前时间  没有过期 after
用户时间 < 当前时间  过期 before
This commit is contained in:
shimingxy
2025-01-03 17:29:45 +08:00
parent c44715c6ee
commit 48bc66d735
2 changed files with 44 additions and 1 deletions
@@ -122,7 +122,7 @@ public class AuthJwtService {
if(StringUtils.isNotBlank(authToken) && authToken.length() > 20) {
try {
JWTClaimsSet claims = resolve(authToken);
boolean isExpiration = claims.getExpirationTime().before(DateTime.now().toDate());
boolean isExpiration = claims.getExpirationTime().after(DateTime.now().toDate());
boolean isVerify = hmac512Service.verify(authToken);
_logger.debug("JWT Validate {} " , isVerify && isExpiration);