diff --git a/src/Controller/AuthmanOauthAuthorizationCodeController.php b/src/Controller/AuthmanOauthAuthorizationCodeController.php index 2f73a07..e124fd9 100644 --- a/src/Controller/AuthmanOauthAuthorizationCodeController.php +++ b/src/Controller/AuthmanOauthAuthorizationCodeController.php @@ -45,6 +45,7 @@ public static function create(ContainerInterface $container) { $instance->authmanOauthFactory = $container->get('authman.oauth'); $instance->messenger = $container->get('messenger'); $instance->currentUser = $container->get('current_user'); + $instance->stringTranslation = $container->get('string_translation'); return $instance; } @@ -106,13 +107,15 @@ public function start(AuthmanAuthInterface $authman_auth): Response { * A redirect response. */ public function receive(Request $request, AuthmanAuthInterface $authman_auth): Response { + $authmanConfigId = $authman_auth->id(); + // @todo #94/#95 - $tokenInfoUrl = Url::fromRoute('entity.authman_auth.information', ['authman_auth' => $authman_auth->id()]); + $tokenInfoUrl = Url::fromRoute('entity.authman_auth.information', ['authman_auth' => $authmanConfigId]); // Code generated by authorization server and passed back to us by the // user agent. $authorizationCode = $request->query->get('code'); - $authmanInstance = $this->authmanOauthFactory->get($authman_auth->id()); + $authmanInstance = $this->authmanOauthFactory->get($authmanConfigId); try { // Get the token via the provided authorization code. $token = $authmanInstance->getAccessToken(AuthmanAuthInterface::GRANT_AUTHORIZATION_CODE, ['code' => $authorizationCode]); @@ -148,7 +151,7 @@ public function receive(Request $request, AuthmanAuthInterface $authman_auth): R /** * Get key config storage. * - * @return \Drupal\authman\EntityHandlers\AuthmanAuthStorage + * @return \Drupal\Core\Config\Entity\ConfigEntityStorageInterface * The key config storage. */ protected function keyStorage(): EntityStorageInterface {