jpadilla / django-rest-framework-jwt

JSON Web Token Authentication support for Django REST Framework
http://jpadilla.github.io/django-rest-framework-jwt/
MIT License
3.19k stars 652 forks source link

why overriding resetful JSONWebTokenSerializer keeps returning token only #302

Open et4891 opened 7 years ago

et4891 commented 7 years ago

I actually asked this on stackoverflow but no replies yet

http://stackoverflow.com/questions/41880457/why-overriding-resetful-jsonwebtokenserializer-keeps-returning-token-only-pytho

Actually spent sometime and I found out it's because the return is actually in JSONWebTokenAPIView 's post function. If I also want to override this, how can I and I have tried to print(serializer.is_valid()) which returned True Also, able to find my user object with serializer.object.get('user'), why would my respond_data for user becomes null though?

hairetdin commented 7 years ago

You can use additional setting - JWT_RESPONSE_PAYLOAD_HANDLER.