Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Commit

Permalink
Merge 99be8e5 into c270841
Browse files Browse the repository at this point in the history
  • Loading branch information
yashpokar committed Nov 14, 2018
2 parents c270841 + 99be8e5 commit 7396d95
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion flask_jwt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,13 @@ def _default_request_handler():


def _default_auth_request_handler():
data = request.get_json()
data = dict()

try:
data = request.get_json()
except:
raise JWTError('Bad Request', 'Request payload must be in json format.')

username = data.get(current_app.config.get('JWT_AUTH_USERNAME_KEY'), None)
password = data.get(current_app.config.get('JWT_AUTH_PASSWORD_KEY'), None)
criterion = [username, password, len(data) == 2]
Expand Down

0 comments on commit 7396d95

Please sign in to comment.