Commit 58cbc388 authored by Nicolas Widart's avatar Nicolas Widart

Removing auth contract usage. Was not always bound to implementation if error happens too soon.

parent b9d45de2
...@@ -28,17 +28,6 @@ class Handler extends ExceptionHandler ...@@ -28,17 +28,6 @@ class Handler extends ExceptionHandler
ValidationException::class, ValidationException::class,
]; ];
/**
* @var Authentication
*/
private $auth;
public function __construct(Container $container, Authentication $auth)
{
parent::__construct($container);
$this->auth = $auth;
}
/** /**
* Report or log an exception. * Report or log an exception.
* *
...@@ -77,16 +66,10 @@ class Handler extends ExceptionHandler ...@@ -77,16 +66,10 @@ class Handler extends ExceptionHandler
private function handleExceptions($e) private function handleExceptions($e)
{ {
if ($e instanceof ModelNotFoundException) { if ($e instanceof ModelNotFoundException) {
if ($this->auth->check() === false) {
return redirect()->route('login');
}
return response()->view('errors.404', [], 404); return response()->view('errors.404', [], 404);
} }
if ($e instanceof NotFoundHttpException) { if ($e instanceof NotFoundHttpException) {
if ($this->auth->check() === false) {
return redirect()->route('login');
}
return response()->view('errors.404', [], 404); return response()->view('errors.404', [], 404);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment