Replies: 10 comments 14 replies
-
Laravel limitation. Add a redirect route like |
Beta Was this translation helpful? Give feedback.
-
i resolved that with replace the route('login') with filament route in the Authenticate.php middleware
|
Beta Was this translation helpful? Give feedback.
-
In my case I set my filament path to So I am using this as a fix: Route::redirect('/login-redirect', '/login')->name('login'); Seems to work well. |
Beta Was this translation helpful? Give feedback.
-
in you PanelAdminProvider add this: return $panel
->default()
->id('admin')
->path('/')
->login(\Filament\Pages\Auth\Login::class) // -> This line will fix the issue Note: |
Beta Was this translation helpful? Give feedback.
-
While expanding the API, I get this error. When I send a request with an incorrect token, it redirects to the login. It gets fixed by adding "accept application/json" in the header of the request, but I need to define and apply extra middleware for this, I'm looking for a more effective solution. |
Beta Was this translation helpful? Give feedback.
-
Laravel has a hidden feature for this. Just add this to a service providers boot method Authenticate::redirectUsing(fn() => Filament::getCurrentPanel()->route('auth.login')); |
Beta Was this translation helpful? Give feedback.
-
In order to solve it using Laravel 11 we just need to override this behaviour.
You can see we have added a new line inside the callback function that is passed as a parameter to the withMiddleware method: |
Beta Was this translation helpful? Give feedback.
-
I'm using Filament on the root domain and have resorted to this. I hope it helps someone, but I have a feeling it's a bit wonky. return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__ . '/../routes/web.php',
commands: __DIR__ . '/../routes/console.php',
health: '/up',
)
->withMiddleware(function (Middleware $middleware) {
// Add these lines: 👇
$middleware->redirectGuestsTo('/login');
$middleware->redirectTo(
guests: '/login',
users: '/bookings'
);
})
->withExceptions(function (Exceptions $exceptions) {
//
})->create(); |
Beta Was this translation helpful? Give feedback.
-
I was also having this problem, this seems to be the best approach IMO ->withMiddleware(function (Middleware $middleware) {
$middleware->alias([
'auth' => \Filament\Http\Middleware\Authenticate::class
]);
}) @danharrin i think it would be good to be done by fillament by default? or as an option |
Beta Was this translation helpful? Give feedback.
-
This is now fixed in #15041 |
Beta Was this translation helpful? Give feedback.
-
Hi All,
How to fix Route [login] not defined.
I'm using Filament Admin Breeze plugin (https://github.com/jeffgreco13/filament-breezy)
My login page setting in filament config file.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions