mirror of
https://github.com/delight-im/PHP-Auth.git
synced 2025-08-07 16:46:29 +02:00
Validate password in 'changePasswordForUserByUsername' for consistency
This commit is contained in:
@@ -378,9 +378,12 @@ final class Administration extends UserManager {
|
|||||||
* @param string $newPassword the new password to set
|
* @param string $newPassword the new password to set
|
||||||
* @throws UnknownUsernameException if no user with the specified username has been found
|
* @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 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)
|
* @throws AuthError if an internal problem occurred (do *not* catch)
|
||||||
*/
|
*/
|
||||||
public function changePasswordForUserByUsername($username, $newPassword) {
|
public function changePasswordForUserByUsername($username, $newPassword) {
|
||||||
|
$newPassword = self::validatePassword($newPassword);
|
||||||
|
|
||||||
$userData = $this->getUserDataByUsername(
|
$userData = $this->getUserDataByUsername(
|
||||||
\trim($username),
|
\trim($username),
|
||||||
[ 'id' ]
|
[ 'id' ]
|
||||||
|
Reference in New Issue
Block a user