Skip to content

Commit 5a8df54

Browse files
committed
fix return statements for errors
1 parent b7fdbf8 commit 5a8df54

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

app/helpers/authenticate.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ def wrapper(*args, **kwargs):
1717
payload : object = {}
1818

1919
if access_token is None :
20-
return jsonify({'message': 'Access token was not supplied'}), 401
20+
return dict(message = 'Access token was not supplied'), 401
2121

2222
try :
2323
token = access_token.split(' ')[1]
2424
if (access_token.split(' ')[0] != "Bearer"):
25-
return jsonify({'message' : "Bad Authorization header. Expected value 'Bearer <JWT>'"}) , 422
25+
return dict(message = "Bad Authorization header. Expected value 'Bearer <JWT>'") , 422
2626

2727
payload = jwt.decode(token, os.getenv('JWT_Token'), algorithms= ['HS256'])
2828

@@ -39,6 +39,6 @@ def admin_required(fn):
3939
@wraps(fn)
4040
@jwt_required
4141
def wrapper(*args, **kwargs):
42-
42+
4343
return fn(*args, **kwargs)
4444
return wrapper

0 commit comments

Comments
 (0)