dj-rest-auth
dj-rest-auth copied to clipboard
Wrong Documentation on Custom User Models
I have a user model without username and only email and the following settings:
ACCOUNT_AUTHENTICATION_METHOD = 'email'
ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_UNIQUE_EMAIL = True
ACCOUNT_USER_MODEL_USERNAME_FIELD = None
ACCOUNT_USERNAME_REQUIRED = False
ACCOUNT_EMAIL_VERIFICATION = 'none'
For this to work, i need to add a custom LoginSerializer that set username = None:
class CustomLoginSerializer(serializers.LoginSerializer):
username = None
Now when I open http://127.0.0.1:8000/dj-rest-auth/login/ the self describing api tells me in the description Accept the following POST parameters: username, password Return the REST Framework Token Object's key.
It should tell me to use the parameters: email and password not username.
I have found no way to replace the LoginView or to change the description.
Secondly it would be nice in dj-rest-auth to respect the above settings and automatically disable usernames if they are disabled.
I'm also having this same issue. I'll be looking into it further for the next few days and I'll share any solutions I find if any
Hey @jerlendds Did you find any solutions, please?