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

Use 'changePasswordForUserById' for 'changePasswordForUserByUsername'

This commit is contained in:
Marco
2018-03-21 02:55:31 +01:00
parent 05165a44a6
commit d7d9899167

View File

@@ -401,19 +401,15 @@ final class Administration extends UserManager {
* @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' ]
);
$this->updatePasswordInternal(
$this->changePasswordForUserById(
(int) $userData['id'],
$newPassword
);
$this->deleteRememberDirectiveForUserById((int) $userData['id']);
}
/**