Upgrade to Laravel 9 (#4413)
Co-authored-by: DaneEveritt <dane@daneeveritt.com>
This commit is contained in:
parent
95e15d2c8a
commit
cbcf62086f
573 changed files with 4387 additions and 9411 deletions
|
@ -14,22 +14,18 @@ use Illuminate\Database\Eloquent\ModelNotFoundException;
|
|||
|
||||
class LoginController extends AbstractLoginController
|
||||
{
|
||||
private ViewFactory $view;
|
||||
|
||||
/**
|
||||
* LoginController constructor.
|
||||
*/
|
||||
public function __construct(ViewFactory $view)
|
||||
public function __construct(private ViewFactory $view)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->view = $view;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle all incoming requests for the authentication routes and render the
|
||||
* base authentication view component. Vuejs will take over at this point and
|
||||
* turn the login area into a SPA.
|
||||
* base authentication view component. React will take over at this point and
|
||||
* turn the login area into an SPA.
|
||||
*/
|
||||
public function index(): View
|
||||
{
|
||||
|
@ -39,8 +35,6 @@ class LoginController extends AbstractLoginController
|
|||
/**
|
||||
* Handle a login request to the application.
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse|void
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\DisplayException
|
||||
* @throws \Illuminate\Validation\ValidationException
|
||||
*/
|
||||
|
@ -56,14 +50,14 @@ class LoginController extends AbstractLoginController
|
|||
|
||||
/** @var \Pterodactyl\Models\User $user */
|
||||
$user = User::query()->where($this->getField($username), $username)->firstOrFail();
|
||||
} catch (ModelNotFoundException $exception) {
|
||||
} catch (ModelNotFoundException) {
|
||||
$this->sendFailedLoginResponse($request);
|
||||
}
|
||||
|
||||
// Ensure that the account is using a valid username and password before trying to
|
||||
// continue. Previously this was handled in the 2FA checkpoint, however that has
|
||||
// a flaw in which you can discover if an account exists simply by seeing if you
|
||||
// can proceede to the next step in the login process.
|
||||
// can proceed to the next step in the login process.
|
||||
if (!password_verify($request->input('password'), $user->password)) {
|
||||
$this->sendFailedLoginResponse($request, $user);
|
||||
}
|
||||
|
|
Reference in a new issue