cleanup
This commit is contained in:
parent
258a11fb2e
commit
72b82426c0
1 changed files with 2 additions and 2 deletions
|
@ -66,7 +66,7 @@ def get_access_token(code):
|
||||||
'client_secret': settings.OAUTH["CLIENT_SECRET"],
|
'client_secret': settings.OAUTH["CLIENT_SECRET"],
|
||||||
'redirect_uri': settings.OAUTH["REDIRECT_URI"]},
|
'redirect_uri': settings.OAUTH["REDIRECT_URI"]},
|
||||||
headers={'Referer': f'{settings.SERVER_URL}/login/zeus/register'})
|
headers={'Referer': f'{settings.SERVER_URL}/login/zeus/register'})
|
||||||
if response.status_code is not 200:
|
if response.status_code != 200:
|
||||||
raise OAuthException(
|
raise OAuthException(
|
||||||
f'Status code {response.status_code} when requesting access token.\nresponse: {response.text}')
|
f'Status code {response.status_code} when requesting access token.\nresponse: {response.text}')
|
||||||
if 'access_token' not in response.json():
|
if 'access_token' not in response.json():
|
||||||
|
@ -79,7 +79,7 @@ def get_user_info(access_token):
|
||||||
settings.OAUTH["USER_API_URI"],
|
settings.OAUTH["USER_API_URI"],
|
||||||
headers={'Authorization': f'Bearer {access_token}'},
|
headers={'Authorization': f'Bearer {access_token}'},
|
||||||
)
|
)
|
||||||
if response.status_code is not 200:
|
if response.status_code != 200:
|
||||||
raise OAuthException(
|
raise OAuthException(
|
||||||
f'Status code {response.status_code} when requesting user info.\nresponse: {response.text}')
|
f'Status code {response.status_code} when requesting user info.\nresponse: {response.text}')
|
||||||
if 'username' not in response.json() or 'id' not in response.json():
|
if 'username' not in response.json() or 'id' not in response.json():
|
||||||
|
|
Loading…
Reference in a new issue