manager = $manager; } /** * Checks if jwt token is valid. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { try { if(!$this->manager->check()){ throw new AccessUnauthorisedException(); } } catch (Exception $exception) { return (new ApiResponseObject('Authentication', 'To keep your account secure we need to re-validate your account', HttpStatus::ACCESS_UNAUTHORISED))->handler(); } return $next($request); } }