Split the auth module into hashing, password policy, passwords and login
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c72bc8c6af
commit
4e71c809da
8 files changed
+133
-120
No files matched your search
@@ -0,0 +1,13 @@
|
||||
from .hashing import is_password_too_long
|
||||
|
||||
PASSWORD_TOO_LONG_MESSAGE = (
|
||||
"The password must be at most 72 bytes long "
|
||||
"(72 characters, fewer with umlauts or special characters)"
|
||||
)
|
||||
|
||||
|
||||
def validate_password(password: str):
|
||||
"""Returns the (untranslated) error message, or None if the password is valid"""
|
||||
if is_password_too_long(password):
|
||||
return PASSWORD_TOO_LONG_MESSAGE
|
||||
return None
|
||||
Reference in new issue
Block a user