You are here

public function FacebookAuthManager::getFbReRequestUrl in Social Auth Facebook 8

Returns the Facebook login URL for re-requesting email permission.

Return value

string Absolute Facebook login URL where user will be redirected

File

src/FacebookAuthManager.php, line 214

Class

FacebookAuthManager
Contains all Simple FB Connect logic that is related to Facebook interaction.

Namespace

Drupal\social_auth_facebook

Code

public function getFbReRequestUrl() {
  $login_helper = $this->client
    ->getRedirectLoginHelper();

  // Define the URL where Facebook should return the user.
  $return_url = $this->urlGenerator
    ->generateFromRoute('social_auth_facebook.return_from_fb', [], [
    'absolute' => TRUE,
  ]);

  // Define the array of Facebook permissions to re-request.
  $scope = [
    'public_profile',
    'email',
  ];

  // Generate and return the URL where we should redirect the user.
  return $login_helper
    ->getReRequestUrl($return_url, $scope);
}