Refactor authentication check in Index.php

This commit is contained in:
Andras Bacsai 2024-02-12 11:53:28 +01:00
parent 9a858f628d
commit d87a0fe74f

View File

@ -14,7 +14,7 @@ public function mount()
if (!isCloud()) {
return redirect()->route('dashboard');
}
if (!isInstanceAdmin() && session('adminToken') === null) {
if (auth()->user()->id !== 0 && session('adminToken') === null) {
return redirect()->route('dashboard');
}
$this->users = User::whereHas('teams', function ($query) {