mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2024-12-02 13:53:43 +03:00
Merge pull request #52 from ranetpgit/master
Pass context to JWTSerializer and TokenSerializer
This commit is contained in:
commit
a2b8c9ca50
|
@ -52,9 +52,9 @@ class RegisterView(CreateAPIView):
|
||||||
'access_token': self.access_token,
|
'access_token': self.access_token,
|
||||||
'refresh_token': self.refresh_token
|
'refresh_token': self.refresh_token
|
||||||
}
|
}
|
||||||
return JWTSerializer(data).data
|
return JWTSerializer(data, context=self.get_serializer_context()).data
|
||||||
else:
|
else:
|
||||||
return TokenSerializer(user.auth_token).data
|
return TokenSerializer(user.auth_token, context=self.get_serializer_context()).data
|
||||||
|
|
||||||
def create(self, request, *args, **kwargs):
|
def create(self, request, *args, **kwargs):
|
||||||
serializer = self.get_serializer(data=request.data)
|
serializer = self.get_serializer(data=request.data)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user