How to use current Login

Hi, Is it possible to to disable the filament admin login page and use an existing login ?
9 Replies
Andrew Wallo
Andrew Wallo2y ago
Yes, set null to the Login page in the filament config file and find a way to add the one you have.. by adding a route or however you want..
Craig Potter
Craig PotterOP2y ago
Hmm not sure that will work.... Or not completely.... I think I will need to extend vendor/filament/filament/src/Http/Middleware/Authenticate.php and overwrite the protected function redirectTo($request) method. Need to make sure to use my custom Middleware in the filament config under auth as well 🙂
Andrew Wallo
Andrew Wallo2y ago
Umm I mean sure..
Dan Harrin
Dan Harrin2y ago
couldnt you just set up a redirect route with the same name as our old login page? then you dont need to override middleware
Andrew Wallo
Andrew Wallo2y ago
^ You could just redirect to config( ‘filament.path’)
Craig Potter
Craig PotterOP2y ago
Nope because I guess the filament routes are being registered after the laravel routes so doing something like
Route::redirect('/admin/login', '/login');
Route::redirect('/admin/login', '/login');
doesn't work because it is overwritten.
Dan Harrin
Dan Harrin2y ago
Route::redirect('/admin/login', '/login')->name('filament.auth.login'); and also set login to null in config
Craig Potter
Craig PotterOP2y ago
🤦‍♂️ Thanks Dan, that works 😄
toeknee
toeknee2y ago
Also improvement on Dan's code slightly: Route::redirect('/'.config('filament.path').'/login', '/login')->name('filament.auth.login'); Incase you change the route of filament the redirect becomes partially dynamic/
Want results from more Discord servers?
Add your server