Skip to content

Commit

Permalink
Issue #3101048 by neel24, agrochal: Fix coding standards
Browse files Browse the repository at this point in the history
  • Loading branch information
neel24 authored and cdubz committed Jun 9, 2020
1 parent 57540f8 commit 5767795
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions social_auth_pbs.services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ services:
arguments:
- '@config.factory'
- '@logger.factory'
- '@request_stack'

# Logger.

Expand Down
16 changes: 10 additions & 6 deletions src/PbsAuthManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Drupal\Core\Logger\LoggerChannelFactoryInterface;
use Drupal\social_auth\AuthManager\OAuth2Manager;
use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
use Symfony\Component\HttpFoundation\RequestStack;

/**
* Contains all the logic for PBS login integration.
Expand All @@ -19,13 +20,16 @@ class PbsAuthManager extends OAuth2Manager {
* Used for accessing configuration object factory.
* @param \Drupal\Core\Logger\LoggerChannelFactoryInterface $logger_factory
* The logger factory.
* @param \Symfony\Component\HttpFoundation\RequestStack $request_stack
* Used to get the authorization code from the callback request.
*/
public function __construct(ConfigFactory $configFactory,
LoggerChannelFactoryInterface $logger_factory) {
parent::__construct(
$configFactory->get('social_auth_pbs.settings'),
$logger_factory
);
LoggerChannelFactoryInterface $logger_factory,
RequestStack $request_stack) {

parent::__construct($configFactory->get('social_auth_pbs.settings'),
$logger_factory,
$this->request = $request_stack->getCurrentRequest());
}

/**
Expand All @@ -34,7 +38,7 @@ public function __construct(ConfigFactory $configFactory,
public function authenticate() {
try {
$this->setAccessToken($this->client->getAccessToken('authorization_code',
['code' => $_GET['code']]));
['code' => $this->request->query->get('code')]));
}
catch (IdentityProviderException $e) {
$this->loggerFactory->get('social_auth_pbs')
Expand Down

0 comments on commit 5767795

Please sign in to comment.