Open robdekort opened 2 days ago
You can do this already in your own apps for now in bootstrap/app.php
(for Laravel 11)
return Application::configure(basePath: dirname(__DIR__))
->withExceptions(function (Exceptions $exceptions) {
+ $exceptions->render(function (\Symfony\Component\HttpKernel\Exception\HttpException $e) {
+ if ($e->getStatusCode() === 419) {
+ return redirect('/wherever-you-want-them-to-go');
+ }
+ });
})->create();
Nice, thanks @jasonvarga!
There have been quite a few reports on Discord over the last weeks that on non expired browser windows, Laravel apps show the 419 error page after logging in. A retry fixes the issue. The 419 error page is not a pretty sight for clients. I feel it would be better if users would be redirected back to the login screen and get a retry warning there instead.