Skip to content

Commit

Permalink
Merge pull request #14 from drozdowsky/request_in_auth
Browse files Browse the repository at this point in the history
Pass request to django's authenticate
  • Loading branch information
fitodic authored Aug 23, 2019
2 parents ad88ffb + 2b4125b commit 46f0064
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/14.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Pass `request` to `django.contrib.auth.authenticate`.
2 changes: 1 addition & 1 deletion src/rest_framework_jwt/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def validate(self, data):
'password': data.get('password')
}

user = authenticate(**credentials)
user = authenticate(self.context['request'], **credentials)

if not user:
msg = _('Unable to log in with provided credentials.')
Expand Down

0 comments on commit 46f0064

Please sign in to comment.