From c4db8d4a5bd8bdc3a7b4a180fc001b77a7119b80 Mon Sep 17 00:00:00 2001 From: Arachneee Date: Fri, 9 Aug 2024 08:53:22 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=ED=96=89=EC=82=AC=20=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EC=9D=B8=20=EB=B6=88=EA=B0=80=20=EB=B2=84=EA=B7=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/server/haengdong/application/EventService.java | 2 +- .../main/java/server/haengdong/config/AdminInterceptor.java | 6 ++++++ .../src/main/java/server/haengdong/domain/event/Event.java | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/server/src/main/java/server/haengdong/application/EventService.java b/server/src/main/java/server/haengdong/application/EventService.java index 3408a6215..94e0c7d8d 100644 --- a/server/src/main/java/server/haengdong/application/EventService.java +++ b/server/src/main/java/server/haengdong/application/EventService.java @@ -118,7 +118,7 @@ private void validateMemberNameUnique(Event event, String updatedMemberName) { public void validatePassword(EventLoginAppRequest request) throws HaengdongException { Event event = getEvent(request.token()); - if (event.isSamePassword(request.password())) { + if (event.isNotSamePassword(request.password())) { throw new AuthenticationException(HaengdongErrorCode.PASSWORD_INVALID); } } diff --git a/server/src/main/java/server/haengdong/config/AdminInterceptor.java b/server/src/main/java/server/haengdong/config/AdminInterceptor.java index af24b783b..bb5e299f6 100644 --- a/server/src/main/java/server/haengdong/config/AdminInterceptor.java +++ b/server/src/main/java/server/haengdong/config/AdminInterceptor.java @@ -25,6 +25,12 @@ public AdminInterceptor(AuthService authService, AuthenticationExtractor authent public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) { log.trace("login request = {}", request.getRequestURI()); + String requestURI = request.getRequestURI(); + + if (requestURI.endsWith("/login")) { + return true; // 요청을 계속 진행하도록 허용 + } + HttpMethod method = HttpMethod.valueOf(request.getMethod()); if (HttpMethod.GET.equals(method) || HttpMethod.OPTIONS.equals(method)) { return true; diff --git a/server/src/main/java/server/haengdong/domain/event/Event.java b/server/src/main/java/server/haengdong/domain/event/Event.java index e90becb3c..cd576a967 100644 --- a/server/src/main/java/server/haengdong/domain/event/Event.java +++ b/server/src/main/java/server/haengdong/domain/event/Event.java @@ -71,7 +71,7 @@ public boolean isTokenMismatch(String token) { return !this.token.equals(token); } - public boolean isSamePassword(String password) { - return this.password.equals(password); + public boolean isNotSamePassword(String password) { + return !this.password.equals(password); } }