Close #5, better handling of TokenMismatchException
This commit is contained in:
parent
cc7212d6b1
commit
706a2ce4ba
1 changed files with 6 additions and 1 deletions
|
@ -3,8 +3,9 @@
|
||||||
namespace App\Exceptions;
|
namespace App\Exceptions;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
|
use Illuminate\Support\Facades\Route;
|
||||||
use Illuminate\Auth\AuthenticationException;
|
use Illuminate\Auth\AuthenticationException;
|
||||||
use Symfony\Component\Debug\Exception\FlattenException;
|
use Illuminate\Session\TokenMismatchException;
|
||||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||||
|
|
||||||
class Handler extends ExceptionHandler
|
class Handler extends ExceptionHandler
|
||||||
|
@ -45,6 +46,10 @@ class Handler extends ExceptionHandler
|
||||||
*/
|
*/
|
||||||
public function render($request, Exception $exception)
|
public function render($request, Exception $exception)
|
||||||
{
|
{
|
||||||
|
if ($exception instanceof TokenMismatchException) {
|
||||||
|
Route::getRoutes()->match($request);
|
||||||
|
}
|
||||||
|
|
||||||
return parent::render($request, $exception);
|
return parent::render($request, $exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue