Skip to content

Commit

Permalink
403 - fix condition for AdminPanelProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrakovich committed Apr 18, 2024
1 parent fb55bee commit 2ce09e8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/app/Providers/AdminPanelProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@
use Illuminate\Routing\Middleware\SubstituteBindings;
use Illuminate\Session\Middleware\AuthenticateSession;
use Illuminate\Session\Middleware\StartSession;
use Illuminate\Support\Facades\App;
use Illuminate\View\Middleware\ShareErrorsFromSession;

class AdminPanelProvider extends PanelProvider
{
public function register(): void
{
$rootPath = strtok(request()->path(), '/');
if (in_array($rootPath, ['admin', 'livewire', 'filament'])) {
if (App::runningInConsole() || in_array($rootPath, ['admin', 'livewire', 'filament'])) {
parent::register();
}
}
Expand Down Expand Up @@ -94,7 +95,7 @@ public function panel(Panel $panel): Panel
->authMiddleware([
Authenticate::class,
])
->authGuard('admin');
// ->spa()
->authGuard('admin')
->spa(false); // !!!
}
}

0 comments on commit 2ce09e8

Please sign in to comment.