判断jwt是否过期,应该是过期时间在当前时间之前才是过期
(cherry picked commit from <gitee.com//dromara/MaxKey/commit/4a2ec5c21ebe320bc5b35f5d3c1f5e880394e29b>
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user