From 62ae2a2f5b3bc29a158126db7b973726097c2d46 Mon Sep 17 00:00:00 2001 From: chaeeun-Han Date: Fri, 22 Mar 2024 17:57:46 +0900 Subject: [PATCH] rafactor: Modify redirect url (#36) --- .../java/com/beotkkot/qtudy/service/auth/AuthService.java | 7 +++++-- src/main/resources/application.yml | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/beotkkot/qtudy/service/auth/AuthService.java b/src/main/java/com/beotkkot/qtudy/service/auth/AuthService.java index dccdf30..1785109 100644 --- a/src/main/java/com/beotkkot/qtudy/service/auth/AuthService.java +++ b/src/main/java/com/beotkkot/qtudy/service/auth/AuthService.java @@ -10,6 +10,7 @@ import com.google.gson.JsonParser; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; @@ -27,6 +28,8 @@ @RequiredArgsConstructor public class AuthService { + @Value("${OAUTH_CLIENT_ID}") + private String OAUTH_CLIENT_ID; private final UserService userService; // 1. 코드를 이용해 카카오로부터 토큰 얻기 @@ -46,8 +49,8 @@ public String getAccessToken(String code) { // HttpBody MultiValueMap params = new LinkedMultiValueMap<>(); params.add("grant_type","authorization_code"); - params.add("client_id", "1aa00eb5cc4f6a4a7678fdbef90fbb97"); - params.add("redirect_uti", "http://localhost:3000/auth/redirected/kakao"); + params.add("client_id", OAUTH_CLIENT_ID); + params.add("redirect_uti", "https://qtudy.site/auth/redirected/kakao"); params.add("code", code); // header, body를 가진 엔티티 diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index b866dc3..01814da 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -19,4 +19,5 @@ spring: # OPEN AI API KEY GPT_API_KEY: ${GPT_API_KEY} CLOVA_API_KEY_ID: ${CLOVA_API_KEY_ID} -CLOVA_API_KEY: ${CLOVA_API_KEY} \ No newline at end of file +CLOVA_API_KEY: ${CLOVA_API_KEY} +OAUTH_CLIENT_ID: ${OAUTH_CLIENT_ID} \ No newline at end of file