public function onError(ErrorEvent $event) { if (!is_null($event) && $event->hasResponse() && $event->getResponse()->hasHeader('WWW-Authenticate')) { throw BearerErrorResponseException::factory($event->getRequest(), $event->getResponse()); } }
public function onRequestException(Event $event) { if (!is_null($event) && !is_null($event['response']) && !is_null($event['response']->getHeader("WWW-Authenticate"))) { throw BearerErrorResponseException::factory($event['request'], $event['response']); } }