From d7d6256f14b3d0136dc298f9a7453d99ce578099 Mon Sep 17 00:00:00 2001 From: Julian Prieber <60265788+JulianPrieber@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:21:35 +0200 Subject: [PATCH] Redirect to login page on expired session https://github.com/LinkStackOrg/LinkStack/issues/598 --- app/Exceptions/Handler.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index c18c43c..3f51d74 100755 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -37,5 +37,11 @@ class Handler extends ExceptionHandler $this->reportable(function (Throwable $e) { // }); + + $this->renderable(function (\Exception $e) { + if ($e->getPrevious() instanceof \Illuminate\Session\TokenMismatchException) { + return redirect()->route('login'); + }; + }); } }