Skip to content

Commit

Permalink
refactor:[#84]- refact Security
Browse files Browse the repository at this point in the history
cors 변경
  • Loading branch information
yooonwodyd committed Nov 15, 2024
1 parent 29a89e0 commit 7593f65
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public WebSecurityCustomizer configure() {

@Bean
public SecurityFilterChain oauth2SecurityFilterChain(HttpSecurity http) throws Exception {
http.cors((cors) -> cors.configurationSource(corsConfigurationSource()));
http
.securityMatcher("/oauth2/**")
.csrf(AbstractHttpConfigurer::disable)
Expand Down Expand Up @@ -101,6 +102,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
@Bean
public CorsConfigurationSource corsConfigurationSource() {
CorsConfiguration configuration = new CorsConfiguration();
http://1.618.s3-website.ap-northeast-2.amazonaws.com'
configuration.setAllowedOrigins(Arrays.asList("http://1.618.s3-website.ap-northeast-2.amazonaws.com","http://localhost:3000"));
configuration.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE", "OPTIONS"));
configuration.setAllowedHeaders(Arrays.asList("Authorization", "Content-Type", "X-Requested-With", "accept", "Origin", "Access-Control-Request-Method", "Access-Control-Request-Headers"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ public interface UserRepository extends JpaRepository<User, Long>, UserCustomRep
Optional<User> findByUserInfoEmail(String email);
Optional<User> findByNickname(String nickname);
Optional<User> findByUserInfoPhone(String phone);
Optional<User> findByEmail(String email);
}

0 comments on commit 7593f65

Please sign in to comment.