Problem with Admin Panel Authentication - 403 Forbidden on Production
I'm having an issue with my Filament admin panel. On localhost, everything works fine, but on production, after logging in, I get a 403 Forbidden error.
Here’s my setup:
- I created a custom
Admin
model and set up a new guard admin
in config/auth.php
:
- I have two panels:
- UserPanel
using the User
model and the default web
guard.
- AdminPanel
using the Admin
model and the admin
guard.
- My AdminPanelProvider.php
config:
What I’ve done so far:
- Tested locally: Works fine.
- On production: The login page loads, but after logging in, it redirects and gives a 403 Forbidden.
What I’ve checked:
1. The guard setup in auth.php
is correct.
2. The Admin
model is set up and has users in production.
3. The session domain and cookies in .env
seem correct.
4. Cleared all caches (config:clear
, route:clear
, cache:clear
, etc.).
What could I be missing? Any help would be greatly appreciated!2 Replies
Solution
I had actually included the canAccessPanel function, but I had forgotten to also include the FilamentUser. Thank you