From b9020fc7b966033699dde18ea4b29fc063505346 Mon Sep 17 00:00:00 2001 From: RMartinOscar <40749467+RMartinOscar@users.noreply.github.com> Date: Sun, 29 Sep 2024 03:30:50 +0000 Subject: [PATCH] Patch User check & Auto Login --- app/Filament/Pages/Installer/PanelInstaller.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/Filament/Pages/Installer/PanelInstaller.php b/app/Filament/Pages/Installer/PanelInstaller.php index 44be752d44..df7143058d 100644 --- a/app/Filament/Pages/Installer/PanelInstaller.php +++ b/app/Filament/Pages/Installer/PanelInstaller.php @@ -24,6 +24,7 @@ use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\Blade; use Illuminate\Support\HtmlString; +use Illuminate\Database\QueryException; /** * @property Form $form @@ -46,15 +47,14 @@ public function getMaxWidth(): MaxWidth|string public static function show(): bool { - if (User::count() <= 0) { - return true; - } - - if (config('panel.client_features.installer.enabled')) { - return true; + try { + if (User::count() > 0) { + return false; + } + } catch (QueryException $e) { } - return false; + return config('panel.client_features.installer.enabled'); } public function mount() @@ -143,7 +143,7 @@ public function submit() ->success() ->send(); - auth()->loginUsingId($user->id); + auth()->guard()->loginUsingId($user->id, true); return redirect('/admin'); } catch (Exception $exception) {