bwdev1
Different log-in behaviour depending on user role
If comes across a similar problem , here is my solution, credits to guy from this thread https://laracasts.com/discuss/channels/general-discussion/filament-redirect-unauthenticated-and-non-admin-users-from-admin-to-a-certain-other-route :
run
app/http/middleware/redirectifnotfilamentadmin.php:
Register this middleware in the AdminPanelServiceProvider
change:
...->authMiddleware([
Authenticate::class,
]);
To
use App\Http\Middleware\RedirectIfNotFilamentAdmin;
...->authMiddleware([
RedirectIfNotFilamentAdmin::class,
]);
16 replies
Different log-in behaviour depending on user role
Youre right, and thats where my problem is - the default login behaviour is to try to redirect the user to the filament panel, so 'clients' are able to log in, but when they try to log in they are met with an error page. However if they navigate back to the homepage again, they will find themselves logged in. Hope that makes sense
16 replies