From 68dea0cf40cd8b04583c726d3163ee35f994f78d Mon Sep 17 00:00:00 2001 From: Jim Simon Date: Thu, 21 Dec 2017 11:39:48 -0500 Subject: [PATCH] Pass Request from JSONWebTokenSerializer to django.contrib.auth.authenticate Closes #387 --- rest_framework_jwt/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework_jwt/serializers.py b/rest_framework_jwt/serializers.py index 12b10a44..0ee5aa6c 100644 --- a/rest_framework_jwt/serializers.py +++ b/rest_framework_jwt/serializers.py @@ -47,7 +47,7 @@ def validate(self, attrs): } if all(credentials.values()): - user = authenticate(**credentials) + user = authenticate(self.context.get('request', None), **credentials) if user: if not user.is_active: