Skip to content

Commit

Permalink
Merge pull request #55 from resum-ai/feat/login
Browse files Browse the repository at this point in the history
Feat/login
  • Loading branch information
yjoonjang authored Mar 30, 2024
2 parents 6a86e5d + d1a4829 commit d597cd5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions accounts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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://localhost:8000/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")

Expand All @@ -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):
Expand Down Expand Up @@ -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}")
Expand All @@ -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}")
Expand Down

0 comments on commit d597cd5

Please sign in to comment.