Commit 249ed8db authored by João Ventura's avatar João Ventura Committed by Joao Ventura
Browse files

Issue #3185898 by cantrellnm, oadaeh, jcnventura: TFA login destination defaults to /user/login

parent c820d135
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -155,10 +155,15 @@ class TfaLoginForm extends UserLoginForm {
      // Begin TFA and set process context.
      // @todo This is used in send plugins which has not been implemented yet.
      // $this->begin($tfaValidationPlugin);
      if (!empty($this->getRequest()->query->get('destination'))) {
        $parameters = $this->destination->getAsArray();
        $this->getRequest()->query->remove('destination');
      }
      else {
        $parameters = [];
      }
      $parameters['uid'] = $user->id();
      $parameters['hash'] = $this->getLoginHash($user);
      $this->getRequest()->query->remove('destination');
      $form_state->setRedirect('tfa.entry', $parameters);
    }
  }