Fixed user authentication backend to allow login with email.

This commit is contained in:
kououken 2019-02-06 13:22:40 -08:00
parent bdddb3cc03
commit d683ea8839
2 changed files with 7 additions and 2 deletions

Binary file not shown.

View file

@ -163,11 +163,16 @@ SITE_ID = 1
# Registration # Registration
ACCOUNT_USER_MODEL_USERNAME_FIELD = 'username' #ACCOUNT_USER_MODEL_USERNAME_FIELD = 'email'
ACCOUNT_EMAIL_REQUIRED = True ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_USERNAME_REQUIRED = False ACCOUNT_USERNAME_REQUIRED = False
ACCOUNT_AUTHENTICATION_METHOD = 'email' ACCOUNT_AUTHENTICATION_METHOD = 'email'
REST_AUTH_REGISTER_SERIALIZERS = { REST_AUTH_REGISTER_SERIALIZERS = {
'REGISTER_SERIALIZER': 'users.serializers.RegisterSerializer', 'REGISTER_SERIALIZER': 'users.serializers.RegisterSerializer',
} }
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend',
'allauth.account.auth_backends.AuthenticationBackend',
)