浏览代码

判断jwt是否过期,应该是过期时间在当前时间之前才是过期
(cherry picked commit from <gitee.com//dromara/MaxKey/commit/4a2ec5c21ebe320bc5b35f5d3c1f5e880394e29b>

zwj 4 月之前
父节点
当前提交
a6faa8cea7

+ 1 - 1
maxkey-authentications/maxkey-authentication-core/src/main/java/org/dromara/maxkey/authn/jwt/AuthJwtService.java

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