Please add ability to add user fields to successful login response
mateoKutnjak opened this issue · 4 comments
Checklist
- I read Contribution Guidelines
- I searched the documentation to ensure that the requested feature is not already implemented and described
- I searched existing issues before opening this one
Describe the solution you'd like
Add LOGIN_OUTPUT_SERIALIZER to settings.py which will shape successful login response.
Describe alternatives you've considered
Copying login view from your library and overriding it endpoint in urls.py.
Additional context
(Add any other context or screenshots about the feature request here)
Thanks for providing detailed description of the issue.
I wonder, why as an alternative can't you just:
- perform login API call
- use the profile API endpoint to get the user profile data from the logged user
I know that registration endpoint is returning user profile data, but there is a particular reason for that. The caller may need information like user id or other information from given call to use it for later (subsequent registration call will yield completely different user), whereas in case of login he/she can get the user data later (until he/she is logged in via session cookie or uses the vaild auth token from the login call).
So I don't see any benefit of adding that feature besides optimising the number of API calls. I can leave this issue open for a while (~3 months) and if there aren't more people interested it, I will close it (otherwise, I will reconsider).
Also, if you see another advantage besides optimising the number of API calls, let me know; I could miss something :)
No, beside fewer API calls there is no advantage.
Ok. Leave it open, maybe someone else can think of advantages.
Thanks for quick response
I'm closing this issue, it looks there aren't more people interested in it.