You are here

protected function GoogleAuth::validateConfig in Open Social 8

Same name and namespace in other branches
  1. 8.9 modules/custom/social_auth_google/src/Plugin/Network/GoogleAuth.php \Drupal\social_auth_google\Plugin\Network\GoogleAuth::validateConfig()
  2. 8.2 modules/custom/social_auth_google/src/Plugin/Network/GoogleAuth.php \Drupal\social_auth_google\Plugin\Network\GoogleAuth::validateConfig()
  3. 8.3 modules/custom/social_auth_google/src/Plugin/Network/GoogleAuth.php \Drupal\social_auth_google\Plugin\Network\GoogleAuth::validateConfig()
  4. 8.4 modules/custom/social_auth_google/src/Plugin/Network/GoogleAuth.php \Drupal\social_auth_google\Plugin\Network\GoogleAuth::validateConfig()
  5. 8.5 modules/custom/social_auth_google/src/Plugin/Network/GoogleAuth.php \Drupal\social_auth_google\Plugin\Network\GoogleAuth::validateConfig()
  6. 8.6 modules/custom/social_auth_google/src/Plugin/Network/GoogleAuth.php \Drupal\social_auth_google\Plugin\Network\GoogleAuth::validateConfig()
  7. 8.7 modules/custom/social_auth_google/src/Plugin/Network/GoogleAuth.php \Drupal\social_auth_google\Plugin\Network\GoogleAuth::validateConfig()
  8. 8.8 modules/custom/social_auth_google/src/Plugin/Network/GoogleAuth.php \Drupal\social_auth_google\Plugin\Network\GoogleAuth::validateConfig()

Checks that module is configured.

Parameters

\Drupal\social_auth_google\Settings\GoogleAuthSettings $settings: The Google auth settings.

Return value

bool True if module is configured, False otherwise.

1 call to GoogleAuth::validateConfig()
GoogleAuth::initSdk in modules/custom/social_auth_google/src/Plugin/Network/GoogleAuth.php
Returns an instance of sdk.

File

modules/custom/social_auth_google/src/Plugin/Network/GoogleAuth.php, line 74

Class

GoogleAuth
Defines a Network Plugin for Social Auth Google.

Namespace

Drupal\social_auth_google\Plugin\Network

Code

protected function validateConfig(GoogleAuthSettings $settings) {
  $client_id = $settings
    ->getClientId();
  $client_secret = $settings
    ->getClientSecret();
  if (!$client_id || !$client_secret) {
    $this->loggerFactory
      ->get('social_auth_google')
      ->error('Define Client ID and Client Secret on module settings.');
    return FALSE;
  }
  return TRUE;
}