From e91395a55d94900da8cf374ce804dbec775adf7f Mon Sep 17 00:00:00 2001 From: Micheal Mand Date: Thu, 27 Jul 2017 10:23:49 -0600 Subject: [PATCH] Fix TokenMismatchException not being handled if `app.debug` is `false` (#358) Signed-off-by: Micheal Mand --- app/Exceptions/Handler.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index b38f48592..06b0aee38 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -54,14 +54,14 @@ public function render($request, Exception $e) return parent::render($request, $e); } - if (config('app.debug') === false) { - return $this->handleExceptions($e); - } - if ($e instanceof TokenMismatchException) { return redirect()->back() - ->withInput($request->except('password')) - ->withErrors(trans('core::core.error token mismatch')); + ->withInput($request->except('password')) + ->withErrors(trans('core::core.error token mismatch')); + } + + if (config('app.debug') === false) { + return $this->handleExceptions($e); } return parent::render($request, $e);