From 38f811784c2fed54c9737717416fa86b894f616c Mon Sep 17 00:00:00 2001 From: Midgard Date: Sat, 25 Jul 2020 13:06:54 +0200 Subject: [PATCH] Remove unneeded code Works without Referer. This allows to eliminate a hardcoded URL path. --- KeRS/settings.py | 1 - oauth/views.py | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/KeRS/settings.py b/KeRS/settings.py index bac1c29..bdacb97 100644 --- a/KeRS/settings.py +++ b/KeRS/settings.py @@ -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' } diff --git a/oauth/views.py b/oauth/views.py index 99123c1..6cca9c1 100644 --- a/oauth/views.py +++ b/oauth/views.py @@ -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}')