Remove unneeded code

Works without Referer. This allows to eliminate a hardcoded URL path.
This commit is contained in:
Midgard 2020-07-25 13:06:54 +02:00
parent ad45243d0b
commit 38f811784c
Signed by: midgard
GPG key ID: 511C112F1331BBB4
2 changed files with 1 additions and 3 deletions

View file

@ -159,5 +159,4 @@ OAUTH = {
'REDIRECT_URI': f'{BASE_URL}/login/zeus/authorized',
'CLIENT_ID': os.getenv('OAUTH_CLIENT_ID', 'tomtest'),
'CLIENT_SECRET': os.getenv('OAUTH_CLIENT_SECRET', 'blargh'),
'REFERER': f'{BASE_URL}/login/zeus/register'
}

View file

@ -64,8 +64,7 @@ def get_access_token(code):
'grant_type': 'authorization_code',
'client_id': settings.OAUTH["CLIENT_ID"],
'client_secret': settings.OAUTH["CLIENT_SECRET"],
'redirect_uri': settings.OAUTH["REDIRECT_URI"]},
headers={'Referer': settings.OAUTH["REFERER"]})
'redirect_uri': settings.OAUTH["REDIRECT_URI"]})
if response.status_code != 200:
raise OAuthException(
f'Status code {response.status_code} when requesting access token.\nresponse: {response.text}')