Exceptions are currently thrown in Koha::Patron->set_password. We need to validate password (with exceptions) without wanting to set the password.
Created attachment 94522 [details] [review] Bug 23865: Throw exceptions in Koha::AuthUtils::is_valid_password Exceptions are currently thrown in Koha::Patron->set_password. We need to validate password (with exceptions) without wanting to set the password. To test: 1. Make sure is_valid_password is not used anywhere in codebase apart from Koha::Patron::set_password (grep -rn 'is_valid_password') 2. prove t/db_dependent/Koha/Patrons.t Observe ok 35 - ->set_password
Created attachment 94523 [details] [review] Bug 23865: Throw exceptions in Koha::AuthUtils::is_valid_password Exceptions are currently thrown in Koha::Patron->set_password. We need to validate password (with exceptions) without wanting to set the password. To test: 1. Make sure is_valid_password is not used anywhere in codebase apart from Koha::Patron::set_password (grep -rn 'is_valid_password') 2. prove t/db_dependent/Koha/Patrons.t Observe ok 35 - ->set_password Sponsored-by: Koha-Suomi Oy
It's "is_password_valid", and it is used in other places: Koha/AuthUtils.pm: ( $is_valid, undef ) = is_password_valid( $password ); Koha/Patron.pm: my ( $is_valid, $error ) = Koha::AuthUtils::is_password_valid( $password ); installer/onboarding.pl: my ( $is_valid, $passworderror) = Koha::AuthUtils::is_password_valid( $firstpassword ); members/memberentry.pl: my ( $is_valid, $error ) = Koha::AuthUtils::is_password_valid( $password ); opac/opac-memberentry.pl: my ( $is_valid, $error ) = Koha::AuthUtils::is_password_valid( $borrower->{password} );