From 75087f1c1794f6665207472a5e872b22712d13e8 Mon Sep 17 00:00:00 2001 From: junpakPark <112045553+junpakPark@users.noreply.github.com> Date: Tue, 19 Sep 2023 20:27:46 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=94=94=EB=B2=84=EA=B9=85=EC=9D=84=20?= =?UTF-8?q?=EC=9C=84=ED=95=9C=20=EC=97=90=EB=9F=AC=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mapbefine/mapbefine/auth/exception/AuthErrorCode.java | 3 ++- .../mapbefine/auth/infrastructure/JwtTokenProvider.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/com/mapbefine/mapbefine/auth/exception/AuthErrorCode.java b/backend/src/main/java/com/mapbefine/mapbefine/auth/exception/AuthErrorCode.java index 50150b86..31eb8b91 100644 --- a/backend/src/main/java/com/mapbefine/mapbefine/auth/exception/AuthErrorCode.java +++ b/backend/src/main/java/com/mapbefine/mapbefine/auth/exception/AuthErrorCode.java @@ -8,7 +8,8 @@ public enum AuthErrorCode { ILLEGAL_TOKEN("01101", "로그인에 실패하였습니다."), FORBIDDEN_ADMIN_ACCESS("01102", "로그인에 실패하였습니다."), BLOCKING_MEMBER_ACCESS("01103", "로그인에 실패하였습니다."), - EXPIRED_TOKEN("01104", "기간이 만료된 토큰입니다.") + EXPIRED_TOKEN("01104", "기간이 만료된 토큰입니다."), + BAD_REQUEST_TOKEN("01005", "잘못된 요청입니다.") ; private final String code; diff --git a/backend/src/main/java/com/mapbefine/mapbefine/auth/infrastructure/JwtTokenProvider.java b/backend/src/main/java/com/mapbefine/mapbefine/auth/infrastructure/JwtTokenProvider.java index f3ec2a3e..01f64a96 100644 --- a/backend/src/main/java/com/mapbefine/mapbefine/auth/infrastructure/JwtTokenProvider.java +++ b/backend/src/main/java/com/mapbefine/mapbefine/auth/infrastructure/JwtTokenProvider.java @@ -1,5 +1,6 @@ package com.mapbefine.mapbefine.auth.infrastructure; +import static com.mapbefine.mapbefine.auth.exception.AuthErrorCode.BAD_REQUEST_TOKEN; import static com.mapbefine.mapbefine.auth.exception.AuthErrorCode.EXPIRED_TOKEN; import static com.mapbefine.mapbefine.auth.exception.AuthErrorCode.ILLEGAL_TOKEN; @@ -75,7 +76,7 @@ public void validateTokensForRemoval(String refreshToken, String accessToken) { if (canRemoveRefreshToken) { return; } - throw new AuthUnauthorizedException(EXPIRED_TOKEN); + throw new AuthUnauthorizedException(BAD_REQUEST_TOKEN); } public void validateAccessToken(String accessToken) {