Skip to content

Commit

Permalink
Merge pull request #52 from ranetpgit/master
Browse files Browse the repository at this point in the history
Pass context to JWTSerializer and TokenSerializer
  • Loading branch information
iMerica committed Apr 22, 2020
2 parents 4a46807 + 2602d66 commit a2b8c9c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dj_rest_auth/registration/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ def get_response_data(self, user):
'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)
Expand Down

0 comments on commit a2b8c9c

Please sign in to comment.