Fix daemon auth

This commit is contained in:
Dane Everitt 2017-11-04 17:16:44 -05:00
parent 1438a50ae9
commit ecdd133b75
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
2 changed files with 7 additions and 5 deletions

View file

@ -13,7 +13,6 @@ use Pterodactyl\Http\Middleware\VerifyReCaptcha;
use Pterodactyl\Http\Middleware\AdminAuthenticate;
use Pterodactyl\Http\Middleware\HMACAuthorization;
use Illuminate\Routing\Middleware\ThrottleRequests;
use Pterodactyl\Http\Middleware\DaemonAuthenticate;
use Pterodactyl\Http\Middleware\LanguageMiddleware;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
use Illuminate\Routing\Middleware\SubstituteBindings;
@ -21,6 +20,7 @@ use Pterodactyl\Http\Middleware\AccessingValidServer;
use Illuminate\View\Middleware\ShareErrorsFromSession;
use Pterodactyl\Http\Middleware\RedirectIfAuthenticated;
use Illuminate\Auth\Middleware\AuthenticateWithBasicAuth;
use Pterodactyl\Http\Middleware\Daemon\DaemonAuthenticate;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Pterodactyl\Http\Middleware\Server\AuthenticateAsSubuser;
use Pterodactyl\Http\Middleware\Server\SubuserBelongsToServer;
@ -28,6 +28,7 @@ use Pterodactyl\Http\Middleware\RequireTwoFactorAuthentication;
use Pterodactyl\Http\Middleware\Server\DatabaseBelongsToServer;
use Pterodactyl\Http\Middleware\Server\ScheduleBelongsToServer;
use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode;
use Pterodactyl\Http\Middleware\DaemonAuthenticate as OldDaemonAuthenticate;
class Kernel extends HttpKernel
{
@ -71,7 +72,7 @@ class Kernel extends HttpKernel
],
'daemon' => [
SubstituteBindings::class,
'daemon-old',
DaemonAuthenticate::class,
],
];
@ -87,7 +88,7 @@ class Kernel extends HttpKernel
'server' => AccessingValidServer::class,
'subuser.auth' => AuthenticateAsSubuser::class,
'admin' => AdminAuthenticate::class,
'daemon-old' => DaemonAuthenticate::class,
'daemon-old' => OldDaemonAuthenticate::class,
'csrf' => VerifyCsrfToken::class,
'throttle' => ThrottleRequests::class,
'can' => Authorize::class,

View file

@ -3,6 +3,7 @@
namespace Pterodactyl\Http\Middleware;
use Closure;
use stdClass;
use GuzzleHttp\Client;
use Illuminate\Http\Request;
use Pterodactyl\Events\Auth\FailedCaptcha;
@ -65,11 +66,11 @@ class VerifyReCaptcha
/**
* Determine if the response from the recaptcha servers was valid.
*
* @param object $result
* @param stdClass $result
* @param \Illuminate\Http\Request $request
* @return bool
*/
private function isResponseVerified(object $result, Request $request): bool
private function isResponseVerified(stdClass $result, Request $request): bool
{
if (! $this->config->get('recaptcha.verify_domain')) {
return false;