From e7b7a469112692b9e1335f5ce2510282071b89f4 Mon Sep 17 00:00:00 2001 From: HolgerHatGarKeineNode Date: Sun, 23 Nov 2025 22:01:17 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=90=20Add=20authentication=20check=20a?= =?UTF-8?q?nd=20redirect=20in=20dashboard=20component?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Ensured unauthenticated users are redirected to the login page upon accessing the dashboard. - Resolved misplaced `Livewire\Volt\Component` import in the file. --- resources/views/livewire/dashboard.blade.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/views/livewire/dashboard.blade.php b/resources/views/livewire/dashboard.blade.php index 0fe61d1..95fcf71 100644 --- a/resources/views/livewire/dashboard.blade.php +++ b/resources/views/livewire/dashboard.blade.php @@ -4,8 +4,8 @@ use App\Attributes\SeoDataAttribute; use App\Models\Meetup; use App\Models\MeetupEvent; use App\Traits\SeoTrait; -use Livewire\Volt\Component; use Flux\Flux; +use Livewire\Volt\Component; new #[SeoDataAttribute(key: 'dashboard')] @@ -18,6 +18,9 @@ class extends Component { public function mount(): void { + if (!auth()->check()) { + $this->redirectRoute('login'); + } $this->country = request()->route('country', config('app.domain_country')); }