Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch User check & Auto Login in the Installer #595

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions app/Filament/Pages/Installer/PanelInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down Expand Up @@ -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) {
Expand Down
Loading