Commit 94b4c0a5 authored by Viktor Bán's avatar Viktor Bán Committed by Ben Jeavons
Browse files

Issue #2628736 by banviktor: 2nd factor skippable when plugin turns from ready...

Issue #2628736 by banviktor: 2nd factor skippable when plugin turns from ready to not ready during process
parent 4f652b83
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -235,6 +235,15 @@ class Tfa {
    return $this->fallback;
  }

  /**
   * Whether it's a fallback process.
   *
   * @return bool
   */
  public function isFallback() {
    return isset($this->context['active_fallback']);
  }

  /**
   * Return TFA context.
   *
+1 −1
Original line number Diff line number Diff line
@@ -268,7 +268,7 @@ function tfa_login_submit($form, &$form_state) {

  $tfa = tfa_get_process($account);
  // Check if TFA has been set up by the account.
  if (!$tfa->ready()) {
  if (!$tfa->ready() && !$tfa->isFallback()) {
    // Allow other modules to act on login when account is not set up for TFA.
    $require_tfa = array_filter(module_invoke_all('tfa_ready_require', $account));
    if (!empty($require_tfa)) {