From 4ad056ef7f009b6ebae92c11abf956a4ed67b3a0 Mon Sep 17 00:00:00 2001 From: yuntasha Date: Thu, 30 May 2024 10:09:18 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20Auth=EC=8B=A4=ED=8C=A8=20=EC=84=9C?= =?UTF-8?q?=EB=B2=84=EB=82=B4=20=EB=A1=9C=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../replyRecoommend/auth/handler/AuthFailureHandler.java | 3 ++- .../java/capstone/replyRecoommend/security/SecurityConfig.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/capstone/replyRecoommend/auth/handler/AuthFailureHandler.java b/src/main/java/capstone/replyRecoommend/auth/handler/AuthFailureHandler.java index 1d4fe3b..0d87c25 100644 --- a/src/main/java/capstone/replyRecoommend/auth/handler/AuthFailureHandler.java +++ b/src/main/java/capstone/replyRecoommend/auth/handler/AuthFailureHandler.java @@ -35,9 +35,10 @@ public void onAuthenticationFailure(HttpServletRequest request, HttpServletRespo errorMessage = "알 수 없는 오류로 로그인 요청을 처리할 수 없습니다. 관리자에게 문의하세요."; } - log.info("Auth Error : "+ exception.getMessage()); + log.info("Auth Error : "+ exception.toString()); errorMessage = URLEncoder.encode(errorMessage, "UTF-8"); setDefaultFailureUrl("/auth/login?error=true&exception="+errorMessage); + super.onAuthenticationFailure(request, response, exception); } } diff --git a/src/main/java/capstone/replyRecoommend/security/SecurityConfig.java b/src/main/java/capstone/replyRecoommend/security/SecurityConfig.java index 379faec..4acd5aa 100644 --- a/src/main/java/capstone/replyRecoommend/security/SecurityConfig.java +++ b/src/main/java/capstone/replyRecoommend/security/SecurityConfig.java @@ -33,7 +33,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity httpSecurity) throws .cors(AbstractHttpConfigurer::disable) // CORS 삭젯 .formLogin(AbstractHttpConfigurer::disable) .authorizeHttpRequests(authorize -> authorize - .requestMatchers("oauth2/authorization/**", "/api/v1/auth/**").permitAll() + .requestMatchers("oauth2/authorization/**", "/api/v1/auth/**", "/login?error").permitAll() .anyRequest().authenticated()) .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) .addFilterBefore(new JwtFilter(userService, accessKey), UsernamePasswordAuthenticationFilter.class)