33namespace App \Exceptions ;
44
55use Exception ;
6- use Illuminate \Auth \AuthenticationException ;
76use Illuminate \Foundation \Exceptions \Handler as ExceptionHandler ;
87
98class Handler extends ExceptionHandler
109{
1110 /**
12- * A list of the exception types that should not be reported.
11+ * A list of the exception types that are not reported.
1312 *
1413 * @var array
1514 */
1615 protected $ dontReport = [
17- \Illuminate \Auth \AuthenticationException::class,
18- \Illuminate \Auth \Access \AuthorizationException::class,
19- \Symfony \Component \HttpKernel \Exception \HttpException::class,
20- \Illuminate \Database \Eloquent \ModelNotFoundException::class,
21- \Illuminate \Session \TokenMismatchException::class,
22- \Illuminate \Validation \ValidationException::class,
16+ //
17+ ];
18+
19+ /**
20+ * A list of the inputs that are never flashed for validation exceptions.
21+ *
22+ * @var array
23+ */
24+ protected $ dontFlash = [
25+ 'password ' ,
26+ 'password_confirmation ' ,
2327 ];
2428
2529 /**
@@ -46,20 +50,4 @@ public function render($request, Exception $exception)
4650 {
4751 return parent ::render ($ request , $ exception );
4852 }
49-
50- /**
51- * Convert an authentication exception into an unauthenticated response.
52- *
53- * @param \Illuminate\Http\Request $request
54- * @param \Illuminate\Auth\AuthenticationException $exception
55- * @return \Illuminate\Http\Response
56- */
57- protected function unauthenticated ($ request , AuthenticationException $ exception )
58- {
59- if ($ request ->expectsJson ()) {
60- return response ()->json (['error ' => 'Unauthenticated. ' ], 401 );
61- }
62-
63- return redirect ()->guest (route ('login ' ));
64- }
6553}
0 commit comments