diff --git a/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/auth/AuthController.java b/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/auth/AuthController.java index ead1c831..5260fcb2 100644 --- a/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/auth/AuthController.java +++ b/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/auth/AuthController.java @@ -5,6 +5,7 @@ import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; +import com.gaebaljip.exceed.common.EatCeedStaticMessage; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -75,21 +76,21 @@ public ApiResponse> logout( } private void setCookie(HttpServletResponse response, String refreshToken) { - Cookie cookie = new Cookie("refreshToken", refreshToken); + Cookie cookie = new Cookie(EatCeedStaticMessage.REFRESH_TOKEN, refreshToken); cookie.setHttpOnly(true); cookie.setSecure(true); response.addCookie(cookie); } private void deleteRefreshCookie(HttpServletResponse response) { - Cookie cookie = new Cookie("refreshToken", null); + Cookie cookie = new Cookie(EatCeedStaticMessage.REFRESH_TOKEN, null); cookie.setMaxAge(0); response.addCookie(cookie); } private Cookie getCookie(Cookie[] cookies) { for (Cookie cookie : cookies) { - if (cookie.getName().equals("refreshToken")) { + if (cookie.getName().equals(EatCeedStaticMessage.REFRESH_TOKEN)) { return cookie; } } diff --git a/BE/exceed/src/main/java/com/gaebaljip/exceed/common/EatCeedStaticMessage.java b/BE/exceed/src/main/java/com/gaebaljip/exceed/common/EatCeedStaticMessage.java index 074ed8f2..4aebeec7 100644 --- a/BE/exceed/src/main/java/com/gaebaljip/exceed/common/EatCeedStaticMessage.java +++ b/BE/exceed/src/main/java/com/gaebaljip/exceed/common/EatCeedStaticMessage.java @@ -3,4 +3,6 @@ public class EatCeedStaticMessage { public static final String REDIS_AUTO_COMPLETE_KEY = "autoComplete"; public static final String REDIS_REFRESH_TOKEN_KEY = "refresh_"; + + public static final String REFRESH_TOKEN = "refreshToken"; }