From 622e4b13c6311e33d790f79e9fa0f5b797fed361 Mon Sep 17 00:00:00 2001 From: doSeung11 Date: Wed, 3 Jul 2024 09:20:42 +0900 Subject: [PATCH] fix: account pw check api --- .../hanafun/account/controller/AccountController.java | 7 ++----- .../com/hanaro/hanafun/common/config/SecurityConfig.java | 1 - 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/hanaro/hanafun/account/controller/AccountController.java b/src/main/java/com/hanaro/hanafun/account/controller/AccountController.java index 032e367..a491391 100644 --- a/src/main/java/com/hanaro/hanafun/account/controller/AccountController.java +++ b/src/main/java/com/hanaro/hanafun/account/controller/AccountController.java @@ -8,10 +8,7 @@ import lombok.RequiredArgsConstructor; import org.springframework.http.ResponseEntity; import org.springframework.security.core.annotation.AuthenticationPrincipal; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -27,7 +24,7 @@ ResponseEntity readAccountList(@AuthenticationPrincipal Long userId return ResponseEntity.ok(new ApiResponse(true, "ok", accountResDtoList)); } - @GetMapping("/pw") + @PostMapping("/pw") ResponseEntity checkAccountPw(@RequestBody PwReqDto pwReqDto){ PwResDto pwResDto = accountService.checkAccountPw(pwReqDto); return ResponseEntity.ok(new ApiResponse(true, "ok", pwResDto)); diff --git a/src/main/java/com/hanaro/hanafun/common/config/SecurityConfig.java b/src/main/java/com/hanaro/hanafun/common/config/SecurityConfig.java index f0f7bfe..d97a5bd 100644 --- a/src/main/java/com/hanaro/hanafun/common/config/SecurityConfig.java +++ b/src/main/java/com/hanaro/hanafun/common/config/SecurityConfig.java @@ -48,7 +48,6 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception, Auth public UrlBasedCorsConfigurationSource corsConfigurationSource() { CorsConfiguration config = new CorsConfiguration(); config.setAllowCredentials(true); - // TODO CORS 설정 변경 필요 config.addAllowedOrigin("http://localhost:3000"); config.addAllowedOrigin("https://hana-fun-fe.vercel.app"); config.addAllowedHeader("*");