Drop remaining references to alerts package

This commit is contained in:
Dane Everitt 2022-02-26 10:40:45 -05:00
parent a3cdfa83f2
commit cc43a6ec64
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
6 changed files with 0 additions and 72 deletions

View file

@ -7,7 +7,6 @@ use Throwable;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use Illuminate\Http\Response; use Illuminate\Http\Response;
use Illuminate\Container\Container; use Illuminate\Container\Container;
use Prologue\Alerts\AlertsMessageBag;
class DisplayException extends PterodactylException class DisplayException extends PterodactylException
{ {
@ -68,8 +67,6 @@ class DisplayException extends PterodactylException
]), method_exists($this, 'getStatusCode') ? $this->getStatusCode() : Response::HTTP_BAD_REQUEST); ]), method_exists($this, 'getStatusCode') ? $this->getStatusCode() : Response::HTTP_BAD_REQUEST);
} }
Container::getInstance()->make(AlertsMessageBag::class)->danger($this->getMessage())->flash();
return redirect()->back()->withInput(); return redirect()->back()->withInput();
} }

View file

@ -5,7 +5,6 @@ namespace Pterodactyl\Http\Middleware;
use Closure; use Closure;
use Illuminate\Support\Str; use Illuminate\Support\Str;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Prologue\Alerts\AlertsMessageBag;
use Pterodactyl\Exceptions\Http\TwoFactorAuthRequiredException; use Pterodactyl\Exceptions\Http\TwoFactorAuthRequiredException;
class RequireTwoFactorAuthentication class RequireTwoFactorAuthentication
@ -19,16 +18,6 @@ class RequireTwoFactorAuthentication
*/ */
protected string $redirectRoute = '/account'; protected string $redirectRoute = '/account';
private AlertsMessageBag $alert;
/**
* RequireTwoFactorAuthentication constructor.
*/
public function __construct(AlertsMessageBag $alert)
{
$this->alert = $alert;
}
/** /**
* Check the user state on the incoming request to determine if they should be allowed to * Check the user state on the incoming request to determine if they should be allowed to
* proceed or not. This checks if the Panel is configured to require 2FA on an account in * proceed or not. This checks if the Panel is configured to require 2FA on an account in
@ -66,9 +55,6 @@ class RequireTwoFactorAuthentication
throw new TwoFactorAuthRequiredException(); throw new TwoFactorAuthRequiredException();
} }
// @phpstan-ignore-next-line
$this->alert->danger(trans('auth.2fa_must_be_enabled'))->flash();
return redirect()->to($this->redirectRoute); return redirect()->to($this->redirectRoute);
} }
} }

View file

@ -35,7 +35,6 @@
"nyholm/psr7": "^1.5.0", "nyholm/psr7": "^1.5.0",
"pragmarx/google2fa": "^8.0.0", "pragmarx/google2fa": "^8.0.0",
"predis/predis": "^1.1.10", "predis/predis": "^1.1.10",
"prologue/alerts": "^0.4.8",
"psr/cache": "^1.0.1", "psr/cache": "^1.0.1",
"s1lentium/iptools": "^1.1.1", "s1lentium/iptools": "^1.1.1",
"spatie/laravel-fractal": "^5.8.1", "spatie/laravel-fractal": "^5.8.1",

View file

@ -182,11 +182,6 @@ return [
Pterodactyl\Providers\RouteServiceProvider::class, Pterodactyl\Providers\RouteServiceProvider::class,
Pterodactyl\Providers\RepositoryServiceProvider::class, Pterodactyl\Providers\RepositoryServiceProvider::class,
Pterodactyl\Providers\ViewComposerServiceProvider::class, Pterodactyl\Providers\ViewComposerServiceProvider::class,
/*
* Additional Dependencies
*/
Prologue\Alerts\AlertsServiceProvider::class,
], ],
/* /*
@ -201,7 +196,6 @@ return [
*/ */
'aliases' => [ 'aliases' => [
'Alert' => Prologue\Alerts\Facades\Alert::class,
'App' => Illuminate\Support\Facades\App::class, 'App' => Illuminate\Support\Facades\App::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class, 'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class, 'Auth' => Illuminate\Support\Facades\Auth::class,

View file

@ -1,37 +0,0 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Alert Levels
|--------------------------------------------------------------------------
|
| The default sort of alert levels which can be called as functions on the
| AlertsMessageBag class. This gives a convenient way to add certain type's
| of messages.
|
| For example:
|
| Alerts::info($message);
|
*/
'levels' => [
'info',
'warning',
'danger',
'success',
],
/*
|--------------------------------------------------------------------------
| Session Key
|--------------------------------------------------------------------------
|
| The session key which is used to store flashed messages into the current
| session. This can be changed if it conflicts with another key.
|
*/
'session_key' => 'alert_messages',
];

View file

@ -5,7 +5,6 @@ namespace Pterodactyl\Tests\Unit\Http\Middleware;
use Mockery as m; use Mockery as m;
use Pterodactyl\Models\User; use Pterodactyl\Models\User;
use Pterodactyl\Models\SecurityKey; use Pterodactyl\Models\SecurityKey;
use Prologue\Alerts\AlertsMessageBag;
use Pterodactyl\Exceptions\Http\TwoFactorAuthRequiredException; use Pterodactyl\Exceptions\Http\TwoFactorAuthRequiredException;
use Pterodactyl\Http\Middleware\RequireTwoFactorAuthentication; use Pterodactyl\Http\Middleware\RequireTwoFactorAuthentication;
@ -13,16 +12,6 @@ class RequireTwoFactorAuthenticationTest extends MiddlewareTestCase
{ {
private $alerts; private $alerts;
/**
* Setup tests.
*/
public function setUp(): void
{
parent::setUp();
$this->alerts = m::mock(AlertsMessageBag::class);
}
public function testNoRequirementUserWithout2fa() public function testNoRequirementUserWithout2fa()
{ {
// Disable the 2FA requirement // Disable the 2FA requirement