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