michaell
michaell
FFilament
Created by michaell on 2/27/2024 in #❓┊help
Disabling sessions in frontend prevents logging in to FilamentPHP backend?
OK, I think I have it? I added this to boot(), and it seems to be working:
Livewire::setUpdateRoute(function ($handle) {
return Route::post('/livewire/update', $handle)
->middleware([
'web',
StartSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
]);
});
Livewire::setUpdateRoute(function ($handle) {
return Route::post('/livewire/update', $handle)
->middleware([
'web',
StartSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
]);
});
7 replies
FFilament
Created by michaell on 2/27/2024 in #❓┊help
Disabling sessions in frontend prevents logging in to FilamentPHP backend?
I tried adding this to AppServiceProvider::boot, but it didn't work:
Livewire::addPersistentMiddleware([
StartSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
]);
Livewire::addPersistentMiddleware([
StartSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
]);
Is that the wrong way to do it?
7 replies
FFilament
Created by michaell on 2/27/2024 in #❓┊help
Disabling sessions in frontend prevents logging in to FilamentPHP backend?
OK, a little more info. If I un-comment the StartSession line in the web middleware, I can log in. If I comment it while I'm on the dashboard page, in development mode, the page almost immediately starts to reload continuously. I'm not surprised that Filament needs session middleware! I am surprised that it seems to need it in the web group, even though it's supposedly using the same middleware itself?
7 replies