New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
custom JWT_RESPONSE_PAYLOAD_HANDLER negated by second call to view serializer #10
Comments
Yes, we are aware that this for is not entirely backwards-compatible with the original library. This is one of those places where the two libraries differ. Have you considered overriding the view's serializer to support the extra fields you've added? |
Please approve the merge this this pull request |
Remove the second response serialization because it breaks custom responses. Fixes Styria-Digital#10
Remove the second response serialization because it breaks custom response payload handlers. Fixes Styria-Digital#10
Remove the second response serialization because it breaks custom response payload handlers. Fixes Styria-Digital#10
See #22 |
Remove the second response serialization because it breaks custom response payload handlers. Fixes Styria-Digital#10
thanks @paymog :) |
Is this thing documented somewhere? I switched libraries and it silently broke my application. At first impression I would consider this a bug, since it negates completely the use of custom payload handlers if I understand correctly. Anyway, what is the rationale behind this change? |
Remove the second response serialization because it breaks custom response payload handlers. Fixes Styria-Digital#10
Remove the second response serialization because it breaks custom response payload handlers. Fixes Styria-Digital#10
Remove the second response serialization because it breaks custom response payload handlers. Fixes Styria-Digital#10
django-rest-framework-jwt/src/rest_framework_jwt/views.py
Line 40 in 9d97eab
The call to self.get_serializer at line 40 in BaseJSONWebTokenAPIView causes the payload created by api_settings.JWT_RESPONSE_PAYLOAD_HANDLER to be run back through the JSONWebTokenSerializer, effectively eliminating anything added to the payload by a custom handler other than the fields in JSONWebTokenSerializer.
For example, the custom payload handler, that I wrote and have been successfully using with the original GetBlimp package, uses "authentication_token", rather than "token" to return the token, and includes some additional pieces of data, but with the new view, the only thing returned by the response is "email".
The text was updated successfully, but these errors were encountered: