Fix: Setup-Route und Wizard gegen fehlende DB absichern (try/catch)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>main
parent
94cddb7987
commit
8551a00414
|
|
@ -48,11 +48,15 @@ class Wizard extends Component
|
||||||
public function mount(): void
|
public function mount(): void
|
||||||
{
|
{
|
||||||
$this->instance_name = config('app.name', 'Mailwolt');
|
$this->instance_name = config('app.name', 'Mailwolt');
|
||||||
|
try {
|
||||||
$this->timezone = Setting::get('timezone', 'Europe/Berlin');
|
$this->timezone = Setting::get('timezone', 'Europe/Berlin');
|
||||||
$this->locale = Setting::get('locale', 'de');
|
$this->locale = Setting::get('locale', 'de');
|
||||||
$this->ui_domain = Setting::get('ui_domain', '');
|
$this->ui_domain = Setting::get('ui_domain', '');
|
||||||
$this->mail_domain = Setting::get('mail_domain', '');
|
$this->mail_domain = Setting::get('mail_domain', '');
|
||||||
$this->webmail_domain = Setting::get('webmail_domain', '');
|
$this->webmail_domain = Setting::get('webmail_domain', '');
|
||||||
|
} catch (\Throwable) {
|
||||||
|
// DB noch nicht migriert — Standardwerte bleiben
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updatedUiDomain(): void { $this->fillEmptyDomains($this->ui_domain); }
|
public function updatedUiDomain(): void { $this->fillEmptyDomains($this->ui_domain); }
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,11 @@ use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
Route::get('/', function () {
|
Route::get('/', function () {
|
||||||
|
try {
|
||||||
$setupDone = \App\Models\Setting::get('setup_completed', '0') === '1';
|
$setupDone = \App\Models\Setting::get('setup_completed', '0') === '1';
|
||||||
|
} catch (\Throwable) {
|
||||||
|
$setupDone = false;
|
||||||
|
}
|
||||||
if (!$setupDone) {
|
if (!$setupDone) {
|
||||||
return redirect()->route('setup');
|
return redirect()->route('setup');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue