Compare commits
No commits in common. "e4a11a8a53fdd727a3e8ace2c02098c8d58d85ee" and "3a7b6ee605f8aff295b6018c8725aaf75e2022f1" have entirely different histories.
e4a11a8a53
...
3a7b6ee605
@ -38,7 +38,7 @@ public class NewsController {
|
||||
|
||||
@PutMapping("/{id}")
|
||||
@JwtVerify
|
||||
public ResponseEntity<MessageResponse> updateNews(@PathVariable Long id, @RequestBody NewsRequest request) {
|
||||
public ResponseEntity<MessageResponse> updateNews(@RequestBody NewsRequest request, @PathVariable Long id) {
|
||||
try {
|
||||
newsService.updateNews(id, request);
|
||||
} catch (DataIntegrityViolationException e) {
|
||||
|
||||
@ -8,7 +8,7 @@ import org.springframework.stereotype.Component;
|
||||
@Aspect
|
||||
@Component
|
||||
public class JwtVerifyAspect {
|
||||
@Before("@annotation(JwtVerify)&&args(..)")
|
||||
@Before("@annotation(JwtVerify)")
|
||||
public void verifyJwtToken(JoinPoint joinPoint) throws JwtValidationException {
|
||||
Object[] args = joinPoint.getArgs();
|
||||
for (Object arg : args) {
|
||||
@ -17,9 +17,9 @@ public class JwtVerifyAspect {
|
||||
if (!JwtUtil.isTokenValid(token)) {
|
||||
throw new JwtValidationException("JWT token is invalid");
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user