From b069ff0d0c0c50f7b516d1852bba45fa33a25a94 Mon Sep 17 00:00:00 2001 From: Joseph Silber Date: Sun, 22 May 2016 15:00:11 -0400 Subject: [PATCH] update exception handler with AuthenticationException --- app/Exceptions/Handler.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 53617ef4..37653f41 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -3,6 +3,7 @@ namespace App\Exceptions; use Exception; +use Illuminate\Auth\AuthenticationException; use Illuminate\Validation\ValidationException; use Illuminate\Auth\Access\AuthorizationException; use Illuminate\Database\Eloquent\ModelNotFoundException; @@ -17,12 +18,25 @@ class Handler extends ExceptionHandler * @var array */ protected $dontReport = [ + AuthenticationException::class, AuthorizationException::class, HttpException::class, ModelNotFoundException::class, ValidationException::class, ]; + /** + * Convert an authentication exception into an unauthenticated response. + * + * @param \Illuminate\Http\Request $request + * @param \Illuminate\Auth\AuthenticationException $e + * @return \Symfony\Component\HttpFoundation\Response + */ + protected function unauthenticated($request, AuthenticationException $e) + { + parent::unauthenticated($request, $e); + } + /** * Report or log an exception. *