diff --git a/app/Exceptions/DisplayException.php b/app/Exceptions/DisplayException.php index 063340a72..7fe855c7f 100644 --- a/app/Exceptions/DisplayException.php +++ b/app/Exceptions/DisplayException.php @@ -7,7 +7,6 @@ use Throwable; use Psr\Log\LoggerInterface; use Illuminate\Http\Response; use Illuminate\Container\Container; -use Prologue\Alerts\AlertsMessageBag; class DisplayException extends PterodactylException { @@ -68,8 +67,6 @@ class DisplayException extends PterodactylException ]), method_exists($this, 'getStatusCode') ? $this->getStatusCode() : Response::HTTP_BAD_REQUEST); } - Container::getInstance()->make(AlertsMessageBag::class)->danger($this->getMessage())->flash(); - return redirect()->back()->withInput(); } diff --git a/app/Http/Middleware/RequireTwoFactorAuthentication.php b/app/Http/Middleware/RequireTwoFactorAuthentication.php index cdf452322..1708960d6 100644 --- a/app/Http/Middleware/RequireTwoFactorAuthentication.php +++ b/app/Http/Middleware/RequireTwoFactorAuthentication.php @@ -5,7 +5,6 @@ namespace Pterodactyl\Http\Middleware; use Closure; use Illuminate\Support\Str; use Illuminate\Http\Request; -use Prologue\Alerts\AlertsMessageBag; use Pterodactyl\Exceptions\Http\TwoFactorAuthRequiredException; class RequireTwoFactorAuthentication @@ -19,16 +18,6 @@ class RequireTwoFactorAuthentication */ 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 * 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(); } - // @phpstan-ignore-next-line - $this->alert->danger(trans('auth.2fa_must_be_enabled'))->flash(); - return redirect()->to($this->redirectRoute); } } diff --git a/composer.json b/composer.json index 1cc1ced4b..87a9a9b9f 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,6 @@ "nyholm/psr7": "^1.5.0", "pragmarx/google2fa": "^8.0.0", "predis/predis": "^1.1.10", - "prologue/alerts": "^0.4.8", "psr/cache": "^1.0.1", "s1lentium/iptools": "^1.1.1", "spatie/laravel-fractal": "^5.8.1", diff --git a/config/app.php b/config/app.php index b0d7cff5a..fb56271d0 100644 --- a/config/app.php +++ b/config/app.php @@ -182,11 +182,6 @@ return [ Pterodactyl\Providers\RouteServiceProvider::class, Pterodactyl\Providers\RepositoryServiceProvider::class, Pterodactyl\Providers\ViewComposerServiceProvider::class, - - /* - * Additional Dependencies - */ - Prologue\Alerts\AlertsServiceProvider::class, ], /* @@ -201,7 +196,6 @@ return [ */ 'aliases' => [ - 'Alert' => Prologue\Alerts\Facades\Alert::class, 'App' => Illuminate\Support\Facades\App::class, 'Artisan' => Illuminate\Support\Facades\Artisan::class, 'Auth' => Illuminate\Support\Facades\Auth::class, diff --git a/config/prologue/alerts.php b/config/prologue/alerts.php deleted file mode 100644 index 16397703a..000000000 --- a/config/prologue/alerts.php +++ /dev/null @@ -1,37 +0,0 @@ - [ - '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', -]; diff --git a/tests/Unit/Http/Middleware/RequireTwoFactorAuthenticationTest.php b/tests/Unit/Http/Middleware/RequireTwoFactorAuthenticationTest.php index 4c242da7e..53ecb0e85 100644 --- a/tests/Unit/Http/Middleware/RequireTwoFactorAuthenticationTest.php +++ b/tests/Unit/Http/Middleware/RequireTwoFactorAuthenticationTest.php @@ -5,7 +5,6 @@ namespace Pterodactyl\Tests\Unit\Http\Middleware; use Mockery as m; use Pterodactyl\Models\User; use Pterodactyl\Models\SecurityKey; -use Prologue\Alerts\AlertsMessageBag; use Pterodactyl\Exceptions\Http\TwoFactorAuthRequiredException; use Pterodactyl\Http\Middleware\RequireTwoFactorAuthentication; @@ -13,16 +12,6 @@ class RequireTwoFactorAuthenticationTest extends MiddlewareTestCase { private $alerts; - /** - * Setup tests. - */ - public function setUp(): void - { - parent::setUp(); - - $this->alerts = m::mock(AlertsMessageBag::class); - } - public function testNoRequirementUserWithout2fa() { // Disable the 2FA requirement