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

Commit 0efa4b0

Browse files
committed
Send complete payload to authenticate_credentials
1 parent 7fde47e commit 0efa4b0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

rest_framework_jwt/authentication.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,17 @@ def authenticate(self, request):
5454
msg = 'Error decoding signature.'
5555
raise exceptions.AuthenticationFailed(msg)
5656

57-
user_id = payload['user_id']
58-
user_email = payload['email']
59-
user = self.authenticate_credentials(user_id, user_email)
57+
user = self.authenticate_credentials(payload)
6058

6159
return (user, auth[1])
6260

63-
def authenticate_credentials(self, user_id, email):
61+
def authenticate_credentials(self, payload):
6462
"""
6563
Returns an active user that matches the payload's user id and email.
6664
"""
6765
try:
66+
user_id = payload['user_id']
67+
email = payload['email']
6868
user = User.objects.get(pk=user_id, email=email, is_active=True)
6969
except User.DoesNotExist:
7070
msg = 'Invalid signature'

0 commit comments

Comments
 (0)