Problems with canAccessPanel what is the filament.app.tenant route?

Really struggling with multiple panels in my app. I have 2 internal panels, app and admin, and one external panel, client. An internal user can login just fine, but having all kinds of problems getting the user logged in on the client panel.

when the user logs in, I either get the credentials don't match error (see screenshot), or I get a 403, and the route that is giving the 403 is filament.app.tenant which is not in the route list and I have no idea what it is.

    public function canAccessPanel(Panel $panel): bool
    {
        dd(Route::currentRouteName()); //shows "filament.app.tenant"
        //dd($panel->getId()); // shows "app", but client user should be "client"
        if (str_ends_with($this->email, '@mydomain.com')) {
            return $this->isInternal() && $this->hasVerifiedEmail();
        } else {
            return $this->hasVerifiedEmail();
        }


i'm pretty sure the problem is my canAccessPanel method, but I'm unsure of what I should even be doing. The panel is "app" when it gets to this method, but the panel should be "client", so how and where do I make sure that's happening? Do I set the panel to the correct one from the canAccessPanel method?
image.png
Solution
Once I figured that out, it seems I just need to tweak my getDefaultTenant() method on my User model to return an empty model in the event that the user isn't internal, which then causes the redirect controller to return the panel url instead of trying to redirect to the tenant registration page.

  public function getDefaultTenant(Panel $panel): ?Model
    {
        if (auth()->user()->isInternal()) {
            return $this->latestTeam;
        }

        return new Team();
    }
Was this page helpful?