Hey folks, as the title says, my team would like to return the payload 
after a user authenticates with extra information (mostly related to the 
user). 
As a solution to this, we would like to redefine ObtainAuthToken 
<https://github.com/encode/django-rest-framework/blob/master/rest_framework/authtoken/views.py#L15>
 as suggested in the docs 
<http://www.django-rest-framework.org/api-guide/authentication/#generating-tokens>
. 
The problem is that the user object after calling the super method is not 
present, so a new query for the user must be done. Another alternative 
would be to copy the whole post function and change it, but I think it 
would be better to call super, and make minor modifications.
So my question is, is there a better way to do this? Would be possible to 
update DRF to add the user to the self in the view (initialized as None)?

Thanks a lot!


-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to