Skip to content
This repository was archived by the owner on May 26, 2020. It is now read-only.

Commit 6fb7f13

Browse files
author
Stan Hu
committed
Fix issue #11: Allow null e-mail addresses
1 parent c665d5b commit 6fb7f13

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

rest_framework_jwt/authentication.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def authenticate_credentials(self, payload):
6565
user_id = payload.get('user_id')
6666
email = payload.get('email')
6767

68-
if user_id and email:
68+
if user_id:
6969
user = User.objects.get(pk=user_id, email=email, is_active=True)
7070
else:
7171
msg = 'Invalid payload'

rest_framework_jwt/tests/test_authentication.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def test_post_form_passing_jwt_invalid_payload(self):
208208
"""
209209
Ensure POSTing json over JWT auth with invalid payload fails
210210
"""
211-
payload = dict(user_id=1, email=None)
211+
payload = dict(email=None)
212212
token = utils.jwt_encode_handler(payload)
213213

214214
auth = 'JWT {0}'.format(token)

0 commit comments

Comments
 (0)