diff --git a/app/Http/Requests/Api/Client/Account/UpdateEmailRequest.php b/app/Http/Requests/Api/Client/Account/UpdateEmailRequest.php index 6287ba585..07d900219 100644 --- a/app/Http/Requests/Api/Client/Account/UpdateEmailRequest.php +++ b/app/Http/Requests/Api/Client/Account/UpdateEmailRequest.php @@ -5,20 +5,16 @@ namespace Pterodactyl\Http\Requests\Api\Client\Account; use Pterodactyl\Models\User; use Illuminate\Container\Container; use Illuminate\Contracts\Hashing\Hasher; -use Pterodactyl\Http\Requests\Api\Client\ClientApiRequest; +use Pterodactyl\Http\Requests\Api\Client\AccountApiRequest; use Pterodactyl\Exceptions\Http\Base\InvalidPasswordProvidedException; -class UpdateEmailRequest extends ClientApiRequest +class UpdateEmailRequest extends AccountApiRequest { /** * @throws \Pterodactyl\Exceptions\Http\Base\InvalidPasswordProvidedException */ public function authorize(): bool { - if (!parent::authorize()) { - return false; - } - $hasher = Container::getInstance()->make(Hasher::class); // Verify password matches when changing password or email. diff --git a/app/Http/Requests/Api/Client/Account/UpdatePasswordRequest.php b/app/Http/Requests/Api/Client/Account/UpdatePasswordRequest.php index de8215b07..2fd2b46fa 100644 --- a/app/Http/Requests/Api/Client/Account/UpdatePasswordRequest.php +++ b/app/Http/Requests/Api/Client/Account/UpdatePasswordRequest.php @@ -4,20 +4,16 @@ namespace Pterodactyl\Http\Requests\Api\Client\Account; use Illuminate\Container\Container; use Illuminate\Contracts\Hashing\Hasher; -use Pterodactyl\Http\Requests\Api\Client\ClientApiRequest; +use Pterodactyl\Http\Requests\Api\Client\AccountApiRequest; use Pterodactyl\Exceptions\Http\Base\InvalidPasswordProvidedException; -class UpdatePasswordRequest extends ClientApiRequest +class UpdatePasswordRequest extends AccountApiRequest { /** * @throws \Pterodactyl\Exceptions\Http\Base\InvalidPasswordProvidedException */ public function authorize(): bool { - if (!parent::authorize()) { - return false; - } - $hasher = Container::getInstance()->make(Hasher::class); // Verify password matches when changing password or email. diff --git a/app/Http/Requests/Api/Client/ClientApiRequest.php b/app/Http/Requests/Api/Client/ClientApiRequest.php index 48a9b9e78..707335a59 100644 --- a/app/Http/Requests/Api/Client/ClientApiRequest.php +++ b/app/Http/Requests/Api/Client/ClientApiRequest.php @@ -9,7 +9,7 @@ abstract class ClientApiRequest extends ApiRequest { /** * Returns the permissions string indicating which permission should be used to - * validate that the authenticated user has permission to perform this action aganist + * validate that the authenticated user has permission to perform this action against * the given resource (server). */ abstract public function permission(): string;