Skip to content

Commit

Permalink
Merge pull request #478 from WordPress/fix/471-wp_login_failed
Browse files Browse the repository at this point in the history
Pass a WP_Error object to the `wp_login_failed` filter.
  • Loading branch information
kasparsd authored Oct 17, 2022
2 parents f02692a + 8aa3d78 commit 79c3641
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion class-two-factor-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ public static function login_form_validate_2fa() {

// Ask the provider to verify the second factor.
if ( true !== $provider->validate_authentication( $user ) ) {
do_action( 'wp_login_failed', $user->user_login );
do_action( 'wp_login_failed', $user->user_login, new WP_Error( 'two_factor_invalid', __( 'ERROR: Invalid verification code.', 'two-factor' ) ) );

$login_nonce = self::create_login_nonce( $user->ID );
if ( ! $login_nonce ) {
Expand Down

0 comments on commit 79c3641

Please sign in to comment.