You are here

public function SocialUserLoginForm::submitForm in Open Social 10.0.x

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_user/src/Form/SocialUserLoginForm.php \Drupal\social_user\Form\SocialUserLoginForm::submitForm()
  2. 8 modules/social_features/social_user/src/Form/SocialUserLoginForm.php \Drupal\social_user\Form\SocialUserLoginForm::submitForm()
  3. 8.2 modules/social_features/social_user/src/Form/SocialUserLoginForm.php \Drupal\social_user\Form\SocialUserLoginForm::submitForm()
  4. 8.3 modules/social_features/social_user/src/Form/SocialUserLoginForm.php \Drupal\social_user\Form\SocialUserLoginForm::submitForm()
  5. 8.4 modules/social_features/social_user/src/Form/SocialUserLoginForm.php \Drupal\social_user\Form\SocialUserLoginForm::submitForm()
  6. 8.5 modules/social_features/social_user/src/Form/SocialUserLoginForm.php \Drupal\social_user\Form\SocialUserLoginForm::submitForm()
  7. 8.6 modules/social_features/social_user/src/Form/SocialUserLoginForm.php \Drupal\social_user\Form\SocialUserLoginForm::submitForm()
  8. 8.7 modules/social_features/social_user/src/Form/SocialUserLoginForm.php \Drupal\social_user\Form\SocialUserLoginForm::submitForm()
  9. 8.8 modules/social_features/social_user/src/Form/SocialUserLoginForm.php \Drupal\social_user\Form\SocialUserLoginForm::submitForm()
  10. 10.3.x modules/social_features/social_user/src/Form/SocialUserLoginForm.php \Drupal\social_user\Form\SocialUserLoginForm::submitForm()
  11. 10.1.x modules/social_features/social_user/src/Form/SocialUserLoginForm.php \Drupal\social_user\Form\SocialUserLoginForm::submitForm()
  12. 10.2.x modules/social_features/social_user/src/Form/SocialUserLoginForm.php \Drupal\social_user\Form\SocialUserLoginForm::submitForm()

Form submission handler.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides UserLoginForm::submitForm

File

modules/social_features/social_user/src/Form/SocialUserLoginForm.php, line 124

Class

SocialUserLoginForm
Class SocialUserLoginForm.

Namespace

Drupal\social_user\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $account = $this->userStorage
    ->load($form_state
    ->get('uid'));

  // A destination was set, probably on an exception controller,.
  // @todo Add validation if route exists.
  if (!$this
    ->getRequest()->request
    ->has('destination')) {
    $form_state
      ->setRedirect('<front>');
  }
  else {
    $this
      ->getRequest()->query
      ->set('destination', $this
      ->getRequest()->request
      ->get('destination'));
  }
  user_login_finalize($account);
}