Apply php-cs-fixer changes
This commit is contained in:
parent
cec96062e3
commit
436e686037
72 changed files with 91 additions and 196 deletions
|
@ -17,7 +17,6 @@ class LoginCheckpointController extends AbstractLoginController
|
|||
private Encrypter $encrypter;
|
||||
private Google2FA $google2FA;
|
||||
|
||||
|
||||
/**
|
||||
* LoginCheckpointController constructor.
|
||||
*/
|
||||
|
@ -51,6 +50,7 @@ class LoginCheckpointController extends AbstractLoginController
|
|||
{
|
||||
if ($this->hasTooManyLoginAttempts($request)) {
|
||||
$this->sendLockoutResponse($request);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -66,6 +66,7 @@ class LoginCheckpointController extends AbstractLoginController
|
|||
null,
|
||||
'The authentication token provided has expired, please refresh the page and try again.'
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -69,6 +69,7 @@ class LoginController extends AbstractLoginController
|
|||
if ($this->hasTooManyLoginAttempts($request)) {
|
||||
$this->fireLockoutEvent($request);
|
||||
$this->sendLockoutResponse($request);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -77,6 +78,7 @@ class LoginController extends AbstractLoginController
|
|||
$user = $this->repository->findFirstWhere([[$useColumn, '=', $username]]);
|
||||
} catch (RecordNotFoundException $exception) {
|
||||
$this->sendFailedLoginResponse($request);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -86,12 +88,13 @@ class LoginController extends AbstractLoginController
|
|||
// can proceed to the next step in the login process.
|
||||
if (!password_verify($request->input('password'), $user->password)) {
|
||||
$this->sendFailedLoginResponse($request, $user);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$webauthnKeys = $user->webauthnKeys()->get();
|
||||
|
||||
if (sizeof($webauthnKeys) > 0) {
|
||||
if (count($webauthnKeys) > 0) {
|
||||
$token = Str::random(64);
|
||||
$this->cache->put($token, $user->id, CarbonImmutable::now()->addMinutes(5));
|
||||
|
||||
|
@ -99,7 +102,7 @@ class LoginController extends AbstractLoginController
|
|||
$request->session()->put(self::SESSION_PUBLICKEY_REQUEST, $publicKey);
|
||||
$request->session()->save();
|
||||
|
||||
$methods = [ self::METHOD_WEBAUTHN ];
|
||||
$methods = [self::METHOD_WEBAUTHN];
|
||||
if ($user->use_totp) {
|
||||
$methods[] = self::METHOD_TOTP;
|
||||
}
|
||||
|
@ -112,13 +115,13 @@ class LoginController extends AbstractLoginController
|
|||
'public_key' => $publicKey,
|
||||
],
|
||||
]);
|
||||
} else if ($user->use_totp) {
|
||||
} elseif ($user->use_totp) {
|
||||
$token = Str::random(64);
|
||||
$this->cache->put($token, $user->id, CarbonImmutable::now()->addMinutes(5));
|
||||
|
||||
return new JsonResponse([
|
||||
'complete' => false,
|
||||
'methods' => [ self::METHOD_TOTP ],
|
||||
'methods' => [self::METHOD_TOTP],
|
||||
'confirmation_token' => $token,
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
namespace Pterodactyl\Http\Controllers\Auth;
|
||||
|
||||
use Exception;
|
||||
use Pterodactyl\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
use Pterodactyl\Models\User;
|
||||
use Illuminate\Auth\AuthManager;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use LaravelWebauthn\Facades\Webauthn;
|
||||
|
@ -36,6 +36,7 @@ class WebauthnController extends AbstractLoginController
|
|||
{
|
||||
if ($this->hasTooManyLoginAttempts($request)) {
|
||||
$this->sendLockoutResponse($request);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -51,6 +52,7 @@ class WebauthnController extends AbstractLoginController
|
|||
null,
|
||||
'The authentication token provided has expired, please refresh the page and try again.'
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
$this->auth->guard()->onceUsingId($user->id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue