From ae0c4a43b83d020709a538a650bb7f3fe18a7c2d Mon Sep 17 00:00:00 2001 From: yjoonjang Date: Fri, 29 Mar 2024 17:04:06 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20kakao=20callback=20uri=20http?= =?UTF-8?q?=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- accounts/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accounts/views.py b/accounts/views.py index 524a763..930bed9 100644 --- a/accounts/views.py +++ b/accounts/views.py @@ -34,7 +34,7 @@ BASE_URL = env("BASE_URL") # KAKAO_CALLBACK_URI = BASE_URL + "accounts/kakao/callback/" -KAKAO_CALLBACK_URI = "http://localhost:8000/accounts/kakao/callback/" +KAKAO_CALLBACK_URI = "http://api.resumai.kr/accounts/kakao/callback/" REST_API_KEY = env("KAKAO_REST_API_KEY") CLIENT_SECRET = env("KAKAO_CLIENT_SECRET_KEY") From d1a482950a10403fa9d58d4413c88b4ef7eac642 Mon Sep 17 00:00:00 2001 From: yjoonjang Date: Sat, 30 Mar 2024 23:24:19 +0900 Subject: [PATCH 2/2] =?UTF-8?q?callback=20uri=20=EB=B0=8F=20post=20uri=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- accounts/views.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/accounts/views.py b/accounts/views.py index 930bed9..e72f33c 100644 --- a/accounts/views.py +++ b/accounts/views.py @@ -33,8 +33,8 @@ env.read_env(env_file) BASE_URL = env("BASE_URL") -# KAKAO_CALLBACK_URI = BASE_URL + "accounts/kakao/callback/" -KAKAO_CALLBACK_URI = "http://api.resumai.kr/accounts/kakao/callback/" +KAKAO_CALLBACK_URI = BASE_URL + "accounts/kakao/callback/" +# KAKAO_CALLBACK_URI = "http://api.resumai.kr/accounts/kakao/callback/" REST_API_KEY = env("KAKAO_REST_API_KEY") CLIENT_SECRET = env("KAKAO_CLIENT_SECRET_KEY") @@ -56,6 +56,7 @@ def kakao_login(request): f"https://kauth.kakao.com/oauth/authorize?client_id={REST_API_KEY}&redirect_uri={KAKAO_CALLBACK_URI}&response_type=code" ) + # @extend_schema(exclude=True) # @permission_classes([AllowAny]) # def finish_login(data): @@ -109,7 +110,7 @@ def kakao_callback(request): user = CustomUser.objects.get(email=email) # 유저가 존재하는 경우 logger.warning("유저 존재") - accept = requests.post(f"{BASE_URL}accounts/kakao/login/finish/", data=data) + accept = requests.post("http://localhost:8000/accounts/kakao/login/finish/", data=data) logger.warning(f"accept: {accept}") logger.warning(f"accept.reason: {accept.reason}") logger.warning(f"accept.history: {accept.history}") @@ -132,7 +133,7 @@ def kakao_callback(request): except CustomUser.DoesNotExist: # 기존에 가입된 유저가 없으면 새로 가입 logger.warning("유저 미존재") - accept = requests.post(f"{BASE_URL}accounts/kakao/login/finish/", data=data) + accept = requests.post("http://localhost:8000/accounts/kakao/login/finish/", data=data) logger.warning(f"accept: {accept}") logger.warning(f"accept.reason: {accept.reason}") logger.warning(f"accept.request: {accept.request}")