You are here

protected function SettingsTrait::redirectToUserForm in Social Auth 3.x

Same name and namespace in other branches
  1. 8.2 src/SettingsTrait.php \Drupal\social_auth\SettingsTrait::redirectToUserForm()

Checks if User should be redirected to User Form after creation.

Parameters

\Drupal\user\UserInterface $drupal_user: User object to get the id of user.

Return value

\Symfony\Component\HttpFoundation\RedirectResponse|false A redirect response to user form, if option is enabled. False otherwise

1 call to SettingsTrait::redirectToUserForm()
UserAuthenticator::authenticateNewUser in src/User/UserAuthenticator.php
Authenticates and redirects new users in authentication process.

File

src/SettingsTrait.php, line 105

Class

SettingsTrait
Helper methods for Social Auth and Drupal settings.

Namespace

Drupal\social_auth

Code

protected function redirectToUserForm(UserInterface $drupal_user) {
  if ($this->configFactory
    ->get('social_auth.settings')
    ->get('redirect_user_form')) {
    $redirection = Url::fromRoute('entity.user.edit_form', [
      'user' => $drupal_user
        ->id(),
    ]);
    return new RedirectResponse($redirection
      ->toString());
  }
  return FALSE;
}