mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2025-12-13 23:56:47 +00:00
🔐 Add authentication check and redirect in dashboard component
- Ensured unauthenticated users are redirected to the login page upon accessing the dashboard. - Resolved misplaced `Livewire\Volt\Component` import in the file.
This commit is contained in:
@@ -4,8 +4,8 @@ use App\Attributes\SeoDataAttribute;
|
|||||||
use App\Models\Meetup;
|
use App\Models\Meetup;
|
||||||
use App\Models\MeetupEvent;
|
use App\Models\MeetupEvent;
|
||||||
use App\Traits\SeoTrait;
|
use App\Traits\SeoTrait;
|
||||||
use Livewire\Volt\Component;
|
|
||||||
use Flux\Flux;
|
use Flux\Flux;
|
||||||
|
use Livewire\Volt\Component;
|
||||||
|
|
||||||
new
|
new
|
||||||
#[SeoDataAttribute(key: 'dashboard')]
|
#[SeoDataAttribute(key: 'dashboard')]
|
||||||
@@ -18,6 +18,9 @@ class extends Component {
|
|||||||
|
|
||||||
public function mount(): void
|
public function mount(): void
|
||||||
{
|
{
|
||||||
|
if (!auth()->check()) {
|
||||||
|
$this->redirectRoute('login');
|
||||||
|
}
|
||||||
$this->country = request()->route('country', config('app.domain_country'));
|
$this->country = request()->route('country', config('app.domain_country'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user