diff --git a/src/Auth.php b/src/Auth.php index 0c0b867..8f9915c 100644 --- a/src/Auth.php +++ b/src/Auth.php @@ -271,27 +271,6 @@ final class Auth extends UserManager { $this->authenticateUserInternal($password, null, $username, $rememberDuration); } - /** - * Validates a password - * - * @param string $password the password to validate - * @return string the password if it's valid - * @throws InvalidPasswordException if the password was invalid - */ - private static function validatePassword($password) { - if (empty($password)) { - throw new InvalidPasswordException(); - } - - $password = trim($password); - - if (strlen($password) < 1) { - throw new InvalidPasswordException(); - } - - return $password; - } - /** * Creates a new directive keeping the user logged in ("remember me") * diff --git a/src/UserManager.php b/src/UserManager.php index 60855cf..64383db 100644 --- a/src/UserManager.php +++ b/src/UserManager.php @@ -86,6 +86,27 @@ abstract class UserManager { return $email; } + /** + * Validates a password + * + * @param string $password the password to validate + * @return string the password if it's valid + * @throws InvalidPasswordException if the password was invalid + */ + protected static function validatePassword($password) { + if (empty($password)) { + throw new InvalidPasswordException(); + } + + $password = trim($password); + + if (strlen($password) < 1) { + throw new InvalidPasswordException(); + } + + return $password; + } + /** * Throttles the specified action for the user to protect against too many requests *