Change in `dj_rest_auth.registration.views.RegisterView.get_response_data()` behaviour.
When:
-
TOKEN_SERIALIZERis set -
SESSION_LOGINis not set -
USE_JWTis not set
Prior Behaviour - Version 2.2.8:
dj_rest_auth.registration.views.RegisterView.get_response_data() would return TokenSerializer(user.auth_token, context=self.get_serializer_context()).data: Permalink
Current Behaviour - 3.0.0:
dj_rest_auth.registration.views.RegisterView.get_response_data() returns None: Permalink
The change in behaviour caught me out, as the response returned by RegisterView is now 204 - No Content, rather than 201 - Created with the data from the TokenSerializer.
I've explicitly set SESSION_LOGIN = False to fix this in our project, but thought I'd raise an issue here as it was unexpected.
Actually this behaviour is caused by inconsistent of some default value settings in dj_rest_auth. After 3.0.0, all settings are now consistent. I notice this changed behaviour, but forgot to add the documentation about this. Thanks for raising this issue. We should add documentation to set SESSION_LOGIN=False explicitly if TokenSerializer used or fix the code maybe?
Can you move the settings inside of the REST_AUTH dict @ThomasEnglish ?
In LoginView, Response serializer data is set even if SESSION_LOGIN=True.
It may be better to have the same behavior in LoginView and RegisterView.
Personally, I would like TokenSerializer data to be set in RegisterView even if SESSION_LOGIN=True. Or, it would be great if it could be set in settings.py without having to create our own View.