-
Notifications
You must be signed in to change notification settings - Fork 177
added filter to control whether authcode autosubmits #741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
808cd6a
00605f2
bd499ec
5acf913
aac5403
628a461
da121df
749a8f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -958,6 +958,7 @@ public static function login_html( $user, $login_nonce, $redirect_to, $error_msg | |
| $interim_login = isset( $_REQUEST['interim-login'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended | ||
|
|
||
| $rememberme = intval( self::rememberme() ); | ||
| $auto_submit_authcode = apply_filters( 'two_factor_auto_submit_authcode', true ); | ||
|
masteradhoc marked this conversation as resolved.
Outdated
|
||
|
|
||
| if ( ! function_exists( 'login_header' ) ) { | ||
| // We really should migrate login_header() out of `wp-login.php` so it can be called from an includes file. | ||
|
|
@@ -1076,13 +1077,15 @@ function() { | |
|
|
||
| this.value = value; | ||
|
|
||
| // 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"; | ||
| <?php if ( $auto_submit_authcode ) { ?> | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we use the variable state to generate a JS variable instead? That would allow us to eventually move this JS into an external file and pass that as data to the script. Something like
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Happy to make this change! How/where would you like the JS variable to be output? I could output it as a
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kasparsd any thoughts on the question above on approach?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| // 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"; | ||
| } | ||
| } | ||
| } | ||
| <?php } ?> | ||
| } | ||
| ); | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.