Skip to content

Commit

Permalink
fix json to dict
Browse files Browse the repository at this point in the history
  • Loading branch information
200516bb committed Aug 7, 2023
1 parent a077297 commit 3c091b1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/api/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import jwt
import os
import requests
import json

from app.models.user import UserLocalAuth, UserSocialAuth, User, UserProfile
from app.utils.user import UserProfileDTO, UserService
Expand Down Expand Up @@ -342,7 +343,7 @@ class KakaoOauth(Resource):
@user.doc(responses={200: 'OK'})
@user.doc(responses={400: 'Bad Request'})
def get(self, code):
oauth_token = requests.post(
result = requests.post(
url="https://kauth.kakao.com/oauth/token",
headers={
"Content-type": "application/x-www-form-urlencoded;charset=utf-8"
Expand All @@ -356,7 +357,8 @@ def get(self, code):
},
).json()

kakao_access_token = oauth_token.access_token
oauth_token = json.loads(result)
kakao_access_token = oauth_token['access_token']
profile_request = requests.get(
"https://kapi.kakao.com/v2/user/me", headers={"Authorization": f"Bearer {kakao_access_token}"}
).json()
Expand Down

0 comments on commit 3c091b1

Please sign in to comment.