forked from RyanGoodwill/backend
bugfix@JwtVerify
This commit is contained in:
parent
df6686fc19
commit
fc2c97b502
@ -8,7 +8,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Aspect
|
@Aspect
|
||||||
@Component
|
@Component
|
||||||
public class JwtVerifyAspect {
|
public class JwtVerifyAspect {
|
||||||
@Before("@annotation(JwtVerify)")
|
@Before("@annotation(JwtVerify)&&args(..)")
|
||||||
public void verifyJwtToken(JoinPoint joinPoint) throws JwtValidationException {
|
public void verifyJwtToken(JoinPoint joinPoint) throws JwtValidationException {
|
||||||
Object[] args = joinPoint.getArgs();
|
Object[] args = joinPoint.getArgs();
|
||||||
for (Object arg : args) {
|
for (Object arg : args) {
|
||||||
@ -17,9 +17,9 @@ public class JwtVerifyAspect {
|
|||||||
if (!JwtUtil.isTokenValid(token)) {
|
if (!JwtUtil.isTokenValid(token)) {
|
||||||
throw new JwtValidationException("JWT token is invalid");
|
throw new JwtValidationException("JWT token is invalid");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user