on submit does not allow login to occur When I add an additional "onsubmit" function to the login button, the login doesnt continue 
this is my code function xxx_form_alter(&amp;$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
 if ($form_id=='user_login_form') {
    // Add a custom submit handler to save the array of types back to the config file.
    $form['actions']['submit']['#submit'][] = 'xxx_form_submit';
  }
}

and it goes through the submit but doesnt continue the login functionality.
Use $form['#submit'][] = 'xxx_form_submit'; instead of $form['actions']['submit']['#submit'][] = 'xxx_form_submit';.