Remove unneeded code
Works without Referer. This allows to eliminate a hardcoded URL path.
This commit is contained in:
parent
ad45243d0b
commit
38f811784c
2 changed files with 1 additions and 3 deletions
|
@ -159,5 +159,4 @@ OAUTH = {
|
||||||
'REDIRECT_URI': f'{BASE_URL}/login/zeus/authorized',
|
'REDIRECT_URI': f'{BASE_URL}/login/zeus/authorized',
|
||||||
'CLIENT_ID': os.getenv('OAUTH_CLIENT_ID', 'tomtest'),
|
'CLIENT_ID': os.getenv('OAUTH_CLIENT_ID', 'tomtest'),
|
||||||
'CLIENT_SECRET': os.getenv('OAUTH_CLIENT_SECRET', 'blargh'),
|
'CLIENT_SECRET': os.getenv('OAUTH_CLIENT_SECRET', 'blargh'),
|
||||||
'REFERER': f'{BASE_URL}/login/zeus/register'
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,8 +64,7 @@ def get_access_token(code):
|
||||||
'grant_type': 'authorization_code',
|
'grant_type': 'authorization_code',
|
||||||
'client_id': settings.OAUTH["CLIENT_ID"],
|
'client_id': settings.OAUTH["CLIENT_ID"],
|
||||||
'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': settings.OAUTH["REFERER"]})
|
|
||||||
if response.status_code != 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}')
|
||||||
|
|
Loading…
Reference in a new issue