/** * {@inheritdoc} */ public function markAuthCodeAsUsed($code) { $authCode = $this->authCodeManager->findAuthCodeByToken($code); if (null !== $authCode) { $this->authCodeManager->deleteAuthCode($authCode); } }
/** * {@inheritdoc} */ public function createAuthCode($code, IOAuth2Client $client, $data, $redirect_uri, $expires, $scope = NULL) { if (!$client instanceof ClientInterface) { throw new \InvalidArgumentException('Client has to implement the ClientInterface'); } $authCode = $this->authCodeManager->createAuthCode(); $authCode->setToken($code); $authCode->setClient($client); $authCode->setUser($data); $authCode->setRedirectUri($redirect_uri); $authCode->setExpiresAt($expires); $authCode->setScope($scope); $this->authCodeManager->updateAuthCode($authCode); return $authCode; }