Broken.php in Salesforce Suite 8.4
File
src/Plugin/SalesforceAuthProvider/Broken.php
View source
<?php
namespace Drupal\salesforce\Plugin\SalesforceAuthProvider;
use Drupal\Core\Form\FormStateInterface;
use Drupal\salesforce\Consumer\SalesforceCredentials;
use Drupal\salesforce\SalesforceAuthProviderPluginBase;
use OAuth\Common\Token\TokenInterface;
use OAuth\OAuth2\Service\Exception\MissingRefreshTokenException;
class Broken extends SalesforceAuthProviderPluginBase {
public function getCredentials() {
return new SalesforceCredentials('', '', '');
}
public function refreshAccessToken(TokenInterface $token) {
throw new MissingRefreshTokenException();
}
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$this
->messenger()
->addError($this
->t('Auth provider for %id is missing or broken.', [
'%id' => $this->id,
]));
return $form;
}
}
Classes
Name |
Description |
Broken |
Fallback for broken / missing plugin. |