2nd panel with other authmiddleware
Hello everyone, I have another table with password, also the model that implements FilamentUser etc.., I made another Middleware and added the guard and provider for that specific model, made a custom LoginClass that extend Filament Auth -> Login, defined a route and despite this it doesn't work, the new view point to the default login with users table.
->login(CustomClass::class)
->authMiddleware([
CustomMidd::class
])
Am I forgetting something?
5 Replies
Anyone knows something?
What does „doesn’t work“ mean in your case? I think all you need is to set the
->authGuard()
I mean that even if I already set the authmiddleware, when I access to the new login page I can access to the second panel with the credentials from users table, but since it use the middleware that use the guard and provider related the other table it's strange that I can access with the same login credentials from the first panel
I don't know if I was clear 😅
All the panels work with the same user session. I have similar situation and i have a field in users which is called "role" and its filled with enum values "admin", "owner", "public". And with middleware i am checking the "role". My example is very simple, but i hope it helps as logic
For the role management I'm using shield plugin which is based on spatie-permissions but even if I already have this management I want separate the source table and login also totally. Panels have the authMiddleware wich allows to manage the login system and routing. I don't know where I'm wrong.