From 7593f65c23b054c885714926e6622eaeb6f04b9d Mon Sep 17 00:00:00 2001 From: yooonwodyd Date: Fri, 15 Nov 2024 19:59:51 +0900 Subject: [PATCH] refactor:[#84]- refact Security MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cors 변경 --- .../com/helpmeCookies/global/security/WebSecurityConfig.java | 2 ++ .../java/com/helpmeCookies/user/repository/UserRepository.java | 1 + 2 files changed, 3 insertions(+) diff --git a/src/main/java/com/helpmeCookies/global/security/WebSecurityConfig.java b/src/main/java/com/helpmeCookies/global/security/WebSecurityConfig.java index 0c3a8a2..323f76a 100644 --- a/src/main/java/com/helpmeCookies/global/security/WebSecurityConfig.java +++ b/src/main/java/com/helpmeCookies/global/security/WebSecurityConfig.java @@ -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) @@ -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")); diff --git a/src/main/java/com/helpmeCookies/user/repository/UserRepository.java b/src/main/java/com/helpmeCookies/user/repository/UserRepository.java index f4988f0..cf33ea0 100644 --- a/src/main/java/com/helpmeCookies/user/repository/UserRepository.java +++ b/src/main/java/com/helpmeCookies/user/repository/UserRepository.java @@ -14,4 +14,5 @@ public interface UserRepository extends JpaRepository, UserCustomRep Optional findByUserInfoEmail(String email); Optional findByNickname(String nickname); Optional findByUserInfoPhone(String phone); + Optional findByEmail(String email); }