Skip to content

Commit

Permalink
add logger.fata
Browse files Browse the repository at this point in the history
  • Loading branch information
yjoonjang committed Apr 6, 2024
1 parent 08e268f commit 66fe75d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions accounts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@

@extend_schema(exclude=True)
def kakao_login(request):
logger.fatal(f"https://kauth.kakao.com/oauth/authorize?client_id={REST_API_KEY}&redirect_uri={KAKAO_CALLBACK_URI}&response_type=code")
return redirect(
f"https://kauth.kakao.com/oauth/authorize?client_id={REST_API_KEY}&redirect_uri={KAKAO_CALLBACK_URI}&response_type=code"
)
Expand Down Expand Up @@ -79,22 +80,22 @@ def kakao_login(request):
@api_view(["GET"])
def kakao_callback(request):
code = request.GET.get("code")
logger.info(code)
logger.fatal(code)

# Access Token Request
token_req = requests.get(
f"https://kauth.kakao.com/oauth/token?grant_type=authorization_code&client_id={REST_API_KEY}&client_secret={CLIENT_SECRET}&redirect_uri={KAKAO_CALLBACK_URI}&code={code}"
)

token_req_json = token_req.json()
logger.info(token_req_json)
logger.fatal(token_req_json)

error = token_req_json.get("error")
if error is not None:
raise JSONDecodeError(error)

access_token = token_req_json.get("access_token")
logger.info(access_token)
logger.fatal(access_token)

# Email Request
profile_request = requests.get(
Expand Down

0 comments on commit 66fe75d

Please sign in to comment.