diff --git a/class-two-factor-core.php b/class-two-factor-core.php index 28a12b23..312b34be 100644 --- a/class-two-factor-core.php +++ b/class-two-factor-core.php @@ -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 ) {