apragacz/django-rest-registration

Please add ability to add user fields to successful login response

mateoKutnjak opened this issue · 4 comments

Checklist

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)

Hi @mateoKutnjak

Thanks for providing detailed description of the issue.

I wonder, why as an alternative can't you just:

  1. perform login API call
  2. 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.