-
Notifications
You must be signed in to change notification settings - Fork 662
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Password-validation: while register: avoid password and email being same #633
Comments
I've encountered the same issue and posted to StackOverflow here: https://stackoverflow.com/questions/66780291/how-is-the-userattributesimilarityvalidator-supposed-to-be-used-in-django. Unfortunately, though, at the time of writing, there are no answers. The other three validators work beautifully, but for whatever reason, the first in OP's list, Here is my reposted question:
# my_app/settings.py
AUTH_PASSWORD_VALIDATORS = [
{
'NAME':
'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
...
]
# api/authentication/tests.py
body = {
'username': 'frank',
'email': 'frank@example.com',
'password1': 'frank@example.com',
'password2': 'frank@example.com',
}
response = self.client.post(url, body, format='json'))
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
|
thanks for this, i will check out the patch |
Also note that this repo is not maintained, but another one is active: https://github.com/iMerica/dj-rest-auth I opened a new issue there: iMerica/dj-rest-auth#240 |
I am using django rest auth for registration. I am using email as login and the below are my settings
I am trying the api end point
rest-auth/registration/
Now if i pass
email
andpassword
same, it does not raise password validaiton error.these are my password validators:
How to ensure the password is not similar to email using dango rest auth
The text was updated successfully, but these errors were encountered: