Replies: 4 comments 1 reply
-
anyone? |
Beta Was this translation helpful? Give feedback.
-
**Fair warning: I'm a new developer. Check anything I suggest against the official documentation. ** Your approach seems fine. Filament's login authenticates a user using a guard ('web' by default). Applying the auth middleware to non-Filament routes checks that the user is authenticated (again, using 'web' guard by default). If they logged in via Filament's login, they will pass this test and follow the route. If not, they are redirected to the 'login' route. So your error is appearing because the 'login' route within auth middleware doesn't exist.
Here's what I'd do:
|
Beta Was this translation helpful? Give feedback.
-
look here |
Beta Was this translation helpful? Give feedback.
-
If you want to protect a specific route in Directly specify the Filament middleware: Route::middleware(\Filament\Http\Middleware\Authenticate::class)->get('blahblahblah', BlahController::class); OR Override the default // bootstrap/app.php
->withMiddleware(function (Middleware $middleware) {
$middleware->alias([
'auth' => \Filament\Http\Middleware\Authenticate::class,
]);
}) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
can I use the Filament login functionality for non-filemant pages? I'd like to have a few other pages behind a login-screen. If I add ->middleware('auth') to the route it returns 'no route for login found'.
I could add my own logic or implement JetStream but it's already built into Filament so it seems it should be possible no?
thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions