|
@@ -8,8 +8,6 @@ use Illuminate\Auth\Access\AuthorizationException;
|
|
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
|
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
|
use Laravel\Lumen\Exceptions\Handler as ExceptionHandler;
|
|
use Laravel\Lumen\Exceptions\Handler as ExceptionHandler;
|
|
use Symfony\Component\HttpKernel\Exception\HttpException;
|
|
use Symfony\Component\HttpKernel\Exception\HttpException;
|
|
-use Tymon\JWTAuth\Exceptions\JWTException;
|
|
|
|
-use Tymon\JWTAuth\Exceptions\TokenInvalidException;
|
|
|
|
|
|
|
|
class Handler extends ExceptionHandler
|
|
class Handler extends ExceptionHandler
|
|
{
|
|
{
|
|
@@ -47,13 +45,6 @@ class Handler extends ExceptionHandler
|
|
*/
|
|
*/
|
|
public function render($request, Exception $exception)
|
|
public function render($request, Exception $exception)
|
|
{
|
|
{
|
|
- if($exception instanceof JWTException){
|
|
|
|
- $error = [
|
|
|
|
- 'message' => $exception->getMessage(),
|
|
|
|
- 'code' => 401,
|
|
|
|
- ];
|
|
|
|
- return response()->json($error)->setStatusCode(401);
|
|
|
|
- }
|
|
|
|
return parent::render($request, $exception);
|
|
return parent::render($request, $exception);
|
|
}
|
|
}
|
|
}
|
|
}
|