Single Login and Register Process for Multiple Panels

Hello everyone! I'm a beginner in FilamentPHP. I have a question. How do I achieve a single login and register process across multiple panels? When I put ->login to the AdminPanelProvider, I can login in /admin/login, and when I put also ->login in CustomerPanelProvider, I can login in /customer/login. I want to be able to have only https://localhost.../login and redirect the user to either the Customer or Admin Panel if it meets the required role. How do I achieve this in Filament? Thanks in advance!
Solution:
I created a custom login system outside of filament and connect them to each other
Jump to solution
5 Replies
sadiqgoni13
sadiqgoni1314mo ago
Hi did you find the solution
Solution
DysonSphere
DysonSphere14mo ago
I created a custom login system outside of filament and connect them to each other
sadiqgoni13
sadiqgoni1314mo ago
Please how do you do it
Vp
Vp14mo ago
Just create one page, and on each panel provider you call that page like ->login(MyCustomLoginPage::class) And inside the login function you check like
if (auth()->user()->role == 'admin')
return redirect('admin')
elseif()
...
if (auth()->user()->role == 'admin')
return redirect('admin')
elseif()
...
sadiqgoni13
sadiqgoni1314mo ago
Thankyou very much
Want results from more Discord servers?
Add your server