Don't allow blank passwords on the password change endpoint; closes #2750
This commit is contained in:
parent
16f49f8dc1
commit
7ebe04fb91
2 changed files with 26 additions and 4 deletions
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace Pterodactyl\Http\Requests\Api\Client\Account;
|
||||
|
||||
use Pterodactyl\Models\User;
|
||||
use Pterodactyl\Http\Requests\Api\Client\ClientApiRequest;
|
||||
use Pterodactyl\Exceptions\Http\Base\InvalidPasswordProvidedException;
|
||||
|
||||
|
@ -32,8 +31,8 @@ class UpdatePasswordRequest extends ClientApiRequest
|
|||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
$rules = User::getRulesForUpdate($this->user());
|
||||
|
||||
return ['password' => array_merge($rules['password'], ['confirmed'])];
|
||||
return [
|
||||
'password' => ['required', 'string', 'confirmed', 'min:8'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue