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,7 +163,7 @@ SITE_ID = 1
# Registration
ACCOUNT_USER_MODEL_USERNAME_FIELD = 'username'
#ACCOUNT_USER_MODEL_USERNAME_FIELD = 'email'
ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_USERNAME_REQUIRED = False
ACCOUNT_AUTHENTICATION_METHOD = 'email'
@ -171,3 +171,8 @@ ACCOUNT_AUTHENTICATION_METHOD = 'email'
REST_AUTH_REGISTER_SERIALIZERS = {
'REGISTER_SERIALIZER': 'users.serializers.RegisterSerializer',
}
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend',
'allauth.account.auth_backends.AuthenticationBackend',
)