Need advice on the login logic of my application
Hi, I need some advice on the connection logic of the application I am currently working on and on the implementation I have already set up.
To put it simply, to access the application, one must be logged in. At the user level, there are 2 access levels:
So, for that, I modified the Filament Login class and the toResponse() method to handle redirection based on whether the user is an administrator or a client.
The idea is to manage the redirection based on the base URL and the user role.
I also created a
Everything seems to be working correctly; the only "hiccup" is that the login URL remains tied to
Does that seem correct to you? Or is there a more optimal approach?
Thank you in advance for your advice
To put it simply, to access the application, one must be logged in. At the user level, there are 2 access levels:
- Administrators: who can access the application and the Filament dashboard;
- Clients who can access the application, but not the Filament dashboard.
So, for that, I modified the Filament Login class and the toResponse() method to handle redirection based on whether the user is an administrator or a client.
The idea is to manage the redirection based on the base URL and the user role.
I also created a
home route with a custom Middleware (RedirectIfNotAuthenticated) : Everything seems to be working correctly; the only "hiccup" is that the login URL remains tied to
admin/login and I have the feeling we can't change it (or perhaps I just haven't found how...).Does that seem correct to you? Or is there a more optimal approach?
Thank you in advance for your advice