| @@ -174,10 +174,9 @@ | ||
| 174 | 174 | |
| 175 | 175 | // Verify the code. |
| 176 | 176 | require_once dirname( __FILE__ ) . '/2fa/rfc6238.php'; |
| 177 | 177 | $secret = $this->tfa_get_secret( $user ); |
| 178 | - $code = isset( $_POST['patchstack_2fa_secretkey_verification'] ) ? trim( $_POST['patchstack_2fa_secretkey_verification'] ) : ''; | |
| 179 | - if ( ! TokenAuth6238::verify( $secret, $code ) ) { | |
| 178 | + if ( ! TokenAuth6238::verify( $secret, trim( $_POST['patchstack_2fa_secretkey_verification'] ) ) ) { | |
| 180 | 179 | wc_add_notice( __( 'The 2FA authentication code you entered is invalid.', 'patchstack' ), 'error' ); |
| 181 | 180 | return; |
| 182 | 181 | } |
| 183 | 182 | |