From cbcbb1a68a27f441fb0152cc4142789ddd5b3a7d Mon Sep 17 00:00:00 2001 From: eunsu02 Date: Sat, 30 Dec 2023 00:02:44 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20redirect?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AuthApiController.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/startlion/startlionserver/controller/AuthApiController.java b/src/main/java/com/startlion/startlionserver/controller/AuthApiController.java index acb38f3..802385d 100644 --- a/src/main/java/com/startlion/startlionserver/controller/AuthApiController.java +++ b/src/main/java/com/startlion/startlionserver/controller/AuthApiController.java @@ -41,11 +41,23 @@ public ResponseEntity getGoogleAuthUrl(HttpServletResponse response) throw .build(); } +// @Operation(summary = "소셜 로그인 성공") +// @GetMapping("/login/oauth2/code/google") +// public ResponseEntity oauthGoogleCheck(@RequestParam(value = "code") String authCode) throws Exception{ +// val response = authService.authenticateUser(authCode); +// return ResponseEntity.ok(response); +// } + @Operation(summary = "소셜 로그인 성공") @GetMapping("/login/oauth2/code/google") - public ResponseEntity oauthGoogleCheck(@RequestParam(value = "code") String authCode) throws Exception{ + public ResponseEntity oauthGoogleCheck(@RequestParam(value = "code") String authCode) throws Exception { val response = authService.authenticateUser(authCode); - return ResponseEntity.ok(response); + + String redirectUrl = "http://localhost:3000/auth"; + + return ResponseEntity.status(HttpStatus.FOUND) + .header("Location", redirectUrl) + .body(response); } @Operation(summary = "멤버")