From a44d29ee1eacba928925c1ae2c6c38d7711830b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=A0=95=EB=AF=BC?= Date: Fri, 2 Aug 2024 17:39:51 +0900 Subject: [PATCH] feat: user token exception --- .../edufocus/user/controller/UserController.java | 12 ------------ .../user/model/exception/GlobalExceptionHandler.java | 2 +- backend/src/main/resources/application.properties | 2 +- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/backend/src/main/java/com/edufocus/edufocus/user/controller/UserController.java b/backend/src/main/java/com/edufocus/edufocus/user/controller/UserController.java index 828f717..55306a5 100644 --- a/backend/src/main/java/com/edufocus/edufocus/user/controller/UserController.java +++ b/backend/src/main/java/com/edufocus/edufocus/user/controller/UserController.java @@ -78,9 +78,6 @@ public class UserController { @RequestBody @Parameter(description = "로그인 시 필요한 회원정보(아이디, 비밀번호).", required = true) User user, HttpServletRequest request, HttpServletResponse response) { String token = request.getHeader("Authorization"); - if(jwtUtil.checkToken(token)){ - return new ResponseEntity<>(HttpStatus.FORBIDDEN); - } Map resultMap = new HashMap<>(); 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); - } diff --git a/backend/src/main/java/com/edufocus/edufocus/user/model/exception/GlobalExceptionHandler.java b/backend/src/main/java/com/edufocus/edufocus/user/model/exception/GlobalExceptionHandler.java index 21c3a22..b3b2608 100644 --- a/backend/src/main/java/com/edufocus/edufocus/user/model/exception/GlobalExceptionHandler.java +++ b/backend/src/main/java/com/edufocus/edufocus/user/model/exception/GlobalExceptionHandler.java @@ -10,7 +10,7 @@ public class GlobalExceptionHandler { @ExceptionHandler(InvalidTokenException.class) public ResponseEntity handleInvalidTokenException(InvalidTokenException e) { - return new ResponseEntity<>(e.getMessage(), HttpStatus.BAD_REQUEST); + return new ResponseEntity<>(e.getMessage(), HttpStatus.FORBIDDEN); } // diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index 4b851bd..714d1c9 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -17,7 +17,7 @@ jwt.salt=${SALT} # Access Token ?? ?? (??? ??) #jwt.access-token.expiretime=3600000 -jwt.access-token.expiretime=3000 +jwt.access-token.expiretime=300 # Refresh Token ?? ?? (??? ??) jwt.refresh-token.expiretime=50400000