Skip to content

Commit

Permalink
Merge pull request #53 from yuntasha/hotfix
Browse files Browse the repository at this point in the history
fix: Auth실패 서버내 로그 수정
  • Loading branch information
yuntasha authored May 30, 2024
2 parents a0b7bae + 4ad056e commit d496aa3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d496aa3

Please sign in to comment.