taiga-back icon indicating copy to clipboard operation
taiga-back copied to clipboard

Password validation consistency

Open lmarie23 opened this issue 2 years ago • 1 comments

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

lmarie23 avatar May 31 '23 14:05 lmarie23

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 ;)

mbl-35 avatar Jul 08 '24 10:07 mbl-35