feat: user token exception
This commit is contained in:
parent
03ff837ad5
commit
a44d29ee1e
@ -78,9 +78,6 @@ public class UserController {
|
|||||||
@RequestBody @Parameter(description = "로그인 시 필요한 회원정보(아이디, 비밀번호).", required = true) User user, HttpServletRequest request, HttpServletResponse response) {
|
@RequestBody @Parameter(description = "로그인 시 필요한 회원정보(아이디, 비밀번호).", required = true) User user, HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
|
||||||
String token = request.getHeader("Authorization");
|
String token = request.getHeader("Authorization");
|
||||||
if(jwtUtil.checkToken(token)){
|
|
||||||
return new ResponseEntity<>(HttpStatus.FORBIDDEN);
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
Map<String, Object> resultMap = new HashMap<>();
|
||||||
HttpStatus status = HttpStatus.ACCEPTED;
|
HttpStatus status = HttpStatus.ACCEPTED;
|
||||||
@ -218,15 +215,6 @@ public class UserController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ExceptionHandler(ExpriedTokenException.class)
|
|
||||||
public ResponseEntity<?> handleExpiredTokenException(){
|
|
||||||
return new ResponseEntity<>(HttpStatus.UNAUTHORIZED);
|
|
||||||
|
|
||||||
}
|
|
||||||
@ExceptionHandler(UnAuthorizedException.class)
|
|
||||||
public ResponseEntity<?> handleUnauthorizedException(){
|
|
||||||
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ public class GlobalExceptionHandler {
|
|||||||
|
|
||||||
@ExceptionHandler(InvalidTokenException.class)
|
@ExceptionHandler(InvalidTokenException.class)
|
||||||
public ResponseEntity<String> handleInvalidTokenException(InvalidTokenException e) {
|
public ResponseEntity<String> handleInvalidTokenException(InvalidTokenException e) {
|
||||||
return new ResponseEntity<>(e.getMessage(), HttpStatus.BAD_REQUEST);
|
return new ResponseEntity<>(e.getMessage(), HttpStatus.FORBIDDEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -17,7 +17,7 @@ jwt.salt=${SALT}
|
|||||||
|
|
||||||
# Access Token ?? ?? (??? ??)
|
# Access Token ?? ?? (??? ??)
|
||||||
#jwt.access-token.expiretime=3600000
|
#jwt.access-token.expiretime=3600000
|
||||||
jwt.access-token.expiretime=3000
|
jwt.access-token.expiretime=300
|
||||||
|
|
||||||
# Refresh Token ?? ?? (??? ??)
|
# Refresh Token ?? ?? (??? ??)
|
||||||
jwt.refresh-token.expiretime=50400000
|
jwt.refresh-token.expiretime=50400000
|
||||||
|
Loading…
Reference in New Issue
Block a user