Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Password validation consistency #133

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

lmarie23
Copy link

instead of only a length validation, call django password validators to have consistency in the password strenght policy

instead of only a length validation, call django password validators to have consistency in the password strength policy
@lmarie23 lmarie23 changed the title Update validators.py Password validation consistency May 31, 2023
@mbl-35
Copy link

mbl-35 commented Jul 8, 2024

Hi,
This works fine with plugin django-password-validators, but you should consider to to pass the user information to be able to create or use validators requiring user informations (i.e. dont use 5 last passwords..).
In file staiga-back/taiga/users/api.py, line 219, replace

       try:
            validate_password(password)
        except ValidationError as e: 
            raise exc.WrongArguments(_(str(e.error_list)))

by

       try:
            validate_password(password, request.user)
        except ValidationError as e: 
            raise exc.WrongArguments(_(str(e.error_list)))

Thanks ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants