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

Commit 29e839d

Browse files
authored
Merge pull request #255 from mathiasose/patch-1
APIJWTClient login with any credential format
2 parents 25afd35 + a62b8f6 commit 29e839d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

rest_framework_jwt/test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55

66
class APIJWTClient(APIClient):
7-
def login(self, username, password):
7+
def login(self, **credentials):
88
"""
99
Returns True if login is possible; False if the provided credentials
1010
are incorrect, or the user is inactive.
1111
"""
12-
response = self.post('/api-token-auth/', {"username": username, "password": password},
13-
format='json')
12+
13+
response = self.post('/api-token-auth/', credentials, format='json')
1414
if response.status_code == status.HTTP_200_OK:
1515
self.credentials(
1616
HTTP_AUTHORIZATION="{0} {1}".format(api_settings.JWT_AUTH_HEADER_PREFIX, response.data['token']))

0 commit comments

Comments
 (0)