You are here

public function GoogleAuthManager::getProfile in Open Social 8.5

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

Returns object of a user profile.

Return value

mixed Returns the profile.

Overrides AuthManagerInterface::getProfile

File

modules/custom/social_auth_google/src/GoogleAuthManager.php, line 70

Class

GoogleAuthManager
Class GoogleAuthManager.

Namespace

Drupal\social_auth_google

Code

public function getProfile() {
  if (empty($this->googleService)) {
    $this->googleService = new \Google_Service_Oauth2($this->sdk);
  }
  $this->profile = $this->googleService->userinfo
    ->get();
  return $this->profile;
}