From 14eb482791b77cd1e0fdc194bedfe1b28e8701d8 Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Sat, 21 Aug 2021 12:56:56 -0600 Subject: [PATCH] fix bad merge --- .../Requests/Api/Client/Account/UpdateEmailRequest.php | 8 ++------ .../Requests/Api/Client/Account/UpdatePasswordRequest.php | 8 ++------ app/Http/Requests/Api/Client/ClientApiRequest.php | 2 +- 3 files changed, 5 insertions(+), 13 deletions(-) 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;