diff --git a/class-two-factor-core.php b/class-two-factor-core.php index c034c53d..0ec86973 100644 --- a/class-two-factor-core.php +++ b/class-two-factor-core.php @@ -1142,7 +1142,7 @@ function() { this.value = value; - // Auto-submit if it's the expected length. + // Auto-submit if auto-submit is enabled and entered value is the expected length. if ( expectedLength && value.replace( / /g, '' ).length == expectedLength ) { if ( undefined !== form.requestSubmit ) { form.requestSubmit(); diff --git a/providers/class-two-factor-backup-codes.php b/providers/class-two-factor-backup-codes.php index 6d6896bb..f0f0ba88 100644 --- a/providers/class-two-factor-backup-codes.php +++ b/providers/class-two-factor-backup-codes.php @@ -384,6 +384,7 @@ public static function codes_remaining_for_user( $user ) { public function authentication_page( $user ) { require_once ABSPATH . '/wp-admin/includes/template.php'; + $auto_submit_authcode = $this->is_authcode_auto_submit_enabled(); $code_length = $this->get_backup_code_length( $user ); $code_placeholder = str_repeat( 'X', $code_length ); @@ -411,7 +412,7 @@ public function authentication_page( $user ) { ?>

- +

generate_and_email_token( $user ); } + $auto_submit_authcode = $this->is_authcode_auto_submit_enabled(); $token_length = $this->get_token_length(); $token_placeholder = str_repeat( 'X', $token_length ); @@ -362,7 +363,7 @@ public function authentication_page( $user ) { ?>

- +

get_key() ); + } } diff --git a/providers/class-two-factor-totp.php b/providers/class-two-factor-totp.php index 9726fef3..e06efd7f 100644 --- a/providers/class-two-factor-totp.php +++ b/providers/class-two-factor-totp.php @@ -833,6 +833,7 @@ public function is_available_for_user( $user ) { */ public function authentication_page( $user ) { require_once ABSPATH . '/wp-admin/includes/template.php'; + $auto_submit_authcode = $this->is_authcode_auto_submit_enabled(); ?>

- +