From c57522765346fa7876026374c672b2f9572076e8 Mon Sep 17 00:00:00 2001 From: RinRinPARK Date: Thu, 8 Aug 2024 16:25:56 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20kakao=20login=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../phote/controller/AuthController.kt | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/src/main/kotlin/com/swm_standard/phote/controller/AuthController.kt b/src/main/kotlin/com/swm_standard/phote/controller/AuthController.kt index 4cc26ef..eb6f4ea 100644 --- a/src/main/kotlin/com/swm_standard/phote/controller/AuthController.kt +++ b/src/main/kotlin/com/swm_standard/phote/controller/AuthController.kt @@ -6,12 +6,10 @@ import com.swm_standard.phote.service.GoogleAuthService import com.swm_standard.phote.service.KaKaoAuthService import io.swagger.v3.oas.annotations.Operation import io.swagger.v3.oas.annotations.tags.Tag -import org.springframework.beans.factory.annotation.Value import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RequestParam import org.springframework.web.bind.annotation.RestController -import org.springframework.web.servlet.view.RedirectView @RestController @RequestMapping("/api/auth") @@ -20,12 +18,6 @@ class AuthController( private val googleAuthService: GoogleAuthService, private val kaKaoAuthService: KaKaoAuthService, ) { - @Value("\${KAKAO_REST_API_KEY}") - lateinit var kakaokey: String - - @Value("\${KAKAO_REDIRECT_URI}") - lateinit var kakaoRedirectUri: String - @Operation(summary = "google-login", description = "구글 로그인/회원가입") @GetMapping("/google-login") fun googleLogin( @@ -40,18 +32,7 @@ class AuthController( @Operation(summary = "kakao-login", description = "카카오 로그인/회원가입") @GetMapping("/kakao-login") - fun kakaoLogin(): RedirectView { - val redirectView = RedirectView() - redirectView.url = - "https://kauth.kakao.com/oauth/authorize?response_type=code&" + - "client_id=$kakaokey&redirect_uri=$kakaoRedirectUri" - - return redirectView - } - - @Operation(summary = "kakao-login", description = "카카오 로그인 유저 정보 조회") - @GetMapping("/kakao-token") - fun getKakaoUserInfo( + fun kakaoLogin( @RequestParam code: String, ): BaseResponse { val accessToken = kaKaoAuthService.getTokenFromKakao(code)