Skip to content

Commit d1b4f96

Browse files
committed
chore: fix authentication error
1 parent 953a1b6 commit d1b4f96

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

app/helpers/authenticate.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,18 @@ def wrapper(*args, **kwargs):
1818

1919
if access_token is None:
2020
return dict(message='Access token was not supplied'), 401
21-
2221
try:
2322
token = access_token.split(' ')[1]
2423
if (access_token.split(' ')[0] != "Bearer"):
2524
return dict(message="Bad Authorization header. Expected value 'Bearer <JWT>'"), 422
2625

2726
payload = jwt.decode(token, os.getenv(
2827
'JWT_SALT'), algorithms=['HS256'])
29-
30-
except jwt.exceptions.DecodeError:
28+
print(payload)
29+
except Exception as e:
30+
print(e)
3131
return dict(message="Access token is not valid or key"), 401
32+
3233
return fn(*args, **kwargs)
3334
return wrapper
3435

app/helpers/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def get_project_data(project_id, request):
3737
return SimpleNamespace(status='failed', message="Failed to fetch project for current user", status_code=400)
3838

3939
project_response = project_response.json()
40+
# print(project_response)
4041

4142
project_data = project_response['data']['project']
4243

0 commit comments

Comments
 (0)