Skip to content

Commit d73a57b

Browse files
committed
Enable auth validate passwords
Define some simple validators to use when creating a new user or changing the password. https://docs.djangoproject.com/en/1.11/topics/auth/passwords/#module-django.contrib.auth.password_validation
1 parent 0bac470 commit d73a57b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

readthedocs/settings/base.py

+18
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,24 @@ def USE_PROMOS(self): # noqa
181181
'allauth.account.auth_backends.AuthenticationBackend',
182182
)
183183

184+
AUTH_PASSWORD_VALIDATORS = [
185+
{
186+
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
187+
},
188+
{
189+
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
190+
'OPTIONS': {
191+
'min_length': 9,
192+
}
193+
},
194+
{
195+
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
196+
},
197+
{
198+
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
199+
},
200+
]
201+
184202
MESSAGE_STORAGE = 'readthedocs.notifications.storages.FallbackUniqueStorage'
185203

186204
NOTIFICATION_BACKENDS = [

0 commit comments

Comments
 (0)