ERR_TOO_MANY_REDIRECTS Mutiple Panels Single Panel For Auth Login

Hey! I've set up 4 Filament panels in my Laravel app: Admin, Student, Guardian, and App.

Each has its own dashboard like /admin/dashboard, except App, which is just for login/registration.

After login, users are redirected to their role’s dashboard via a custom LoginResponse.
Example: admin /admin/dashboard.

Issue:
When logged in and visiting /app, I get a "Too many redirects" error.
When logged out, it redirects to the login page (which is fine).

How can I disable or prevent /app access after login?

Here’s my App panel(Default Panel):

$panel
->default()
->id('app')
->path('app')
->login()
->registration()
->middleware(FilamentDefaults)
->authMiddleware([Authenticate::class])


Admin panel uses:

$panel
->id('rolepanels') ->example admin|guardian|student
->path('rolepanels')
->pages([Dashboard::class])
->middleware(FilamentDefaults)
->authMiddleware([
  EnsureUserHasRole::class.':admin',
  Authenticate::class,
])

EnsureUserHasRole.php
class EnsureUserHasRole
{
    public function handle(Request $request, Closure $next, string $role): Response
    {
        if (! Auth::check() || ! Auth::user()->hasRole($role)) {
            abort(403, 'Access denied. You do not have permission to access this panel.');
        }

        return $next($request);
    }
}

running out of characters wil post the response class next
Was this page helpful?