/** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * * @throws \League\OAuth2\Server\Exception\AccessDeniedException * * @return mixed */ public function handle($request, Closure $next) { $this->authorizer->setRequest($request); if ($this->authorizer->getResourceOwnerType() !== 'client') { throw new AccessDeniedException(); } return $next($request); }