1
0
mirror of https://github.com/delight-im/PHP-Auth.git synced 2025-08-06 08:07:27 +02:00

Validate password in 'changePasswordForUserByUsername' for consistency

This commit is contained in:
Marco
2018-03-20 15:54:19 +01:00
parent 131aea3ded
commit 3a7a860c6d

View File

@@ -378,9 +378,12 @@ final class Administration extends UserManager {
* @param string $newPassword the new password to set
* @throws UnknownUsernameException if no user with the specified username has been found
* @throws AmbiguousUsernameException if multiple users with the specified username have been found
* @throws InvalidPasswordException if the desired new password has been invalid
* @throws AuthError if an internal problem occurred (do *not* catch)
*/
public function changePasswordForUserByUsername($username, $newPassword) {
$newPassword = self::validatePassword($newPassword);
$userData = $this->getUserDataByUsername(
\trim($username),
[ 'id' ]