WordPress / WordPress/two-factor

Add hook to turn off auto-submission of 2FA form

Open
#723 3 comments 0 reactions 1 assignee View on GitHub

@eric-michel is already working on this.

Since Dec 18, 2025.

  • #741 by @eric-michel — open
Dominant language
PHP
Stars
825
Forks
187
Avg merge
2d 11h
Merged PRs (30d)
17

Description

Is your enhancement related to a problem? Please describe.

This is related to https://github.com/WordPress/two-factor/issues/722.

In the process of creating our trusted device addon to this plugin, we're having to use a bit of a hack to remove the auto-submission feature from the 2FA form (so that the user has an opportunity to check the "trust this device" checkbox before clicking Verify).

// Auto-submit if it's the expected length.
if ( expectedLength && value.replace( / /g, '' ).length == expectedLength ) {
	if ( undefined !== form.requestSubmit ) {
		form.requestSubmit();
		form.submit.disabled = "disabled";
	}
}
Proposed Solution

Add a hook that allows for a theme or plugin to turn off the auto-submit feature.

Designs

No response

Describe alternatives you've considered

No response

Please confirm that you have searched existing issues in this repository.

Yes

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.