Skip to content
Snippets Groups Projects
Commit 5ff4d358 authored by David Pashaev's avatar David Pashaev
Browse files

Issue #3119944 by gvso, davps: Use parent's request object in AuthManager

parent 5f69efed
No related branches found
No related tags found
No related merge requests found
......@@ -8,9 +8,9 @@ use Drupal\Core\Url;
use Drupal\social_api\SocialApiException;
use Drupal\social_auth\AuthManager\OAuth2Manager;
use Symfony\Component\HttpFoundation\RequestStack;
use VK\OAuth\Scopes\VKOAuthUserScope;
use VK\OAuth\VKOAuth;
use VK\OAuth\VKOAuthDisplay;
use VK\OAuth\Scopes\VKOAuthUserScope;
use VK\OAuth\VKOAuthResponseType;
/**
......@@ -46,13 +46,6 @@ class VkontakteAuthManager extends OAuth2Manager {
*/
protected $oauth;
/**
* The currently active request object.
*
* @var \Symfony\Component\HttpFoundation\Request
*/
protected $request;
/**
* The secret state for the authentication.
*
......@@ -73,10 +66,12 @@ class VkontakteAuthManager extends OAuth2Manager {
public function __construct(ConfigFactory $configFactory,
LoggerChannelFactoryInterface $logger_factory,
RequestStack $request_stack) {
parent::__construct($configFactory->get('social_auth_vk.settings'), $logger_factory);
parent::__construct($configFactory->get('social_auth_vk.settings'),
$logger_factory,
$request_stack->getCurrentRequest());
$this->oauth = new VKOAuth();
$this->request = $request_stack->getCurrentRequest();
}
/**
......@@ -145,7 +140,7 @@ class VkontakteAuthManager extends OAuth2Manager {
$scopes = array_merge($scopes, explode(',', $extra_scopes));
}
return $this->oauth->getAuthorizeUrl(VKOAuthResponseType::CODE, $client_id, $redirect_uri, $display, $scopes, $state);
return $this->oauth->getAuthorizeUrl(VKOAuthResponseType::CODE, (int) $client_id, $redirect_uri, $display, $scopes, $state);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment