fix(captcha): close human-verification loop end-to-end
Rewrite captcha core around aksrt_captcha_config only, require captcha on login/comment/SMS/phone auth and related gates, wire frontend token collection, and remove dead dual-source security settings plus slider enqueue.
This commit is contained in:
@@ -1004,8 +1004,8 @@ add_action('wp_ajax_aksrt_send_email_code', function () {
|
||||
wp_send_json_error( array( 'message' => __( '无效的验证场景', 'aksrt' ) ) );
|
||||
}
|
||||
|
||||
if ( aksrt_is_captcha_enabled_for( $scene ) ) {
|
||||
$captcha_result = aksrt_verify_captcha( $_POST );
|
||||
if ( function_exists( 'aksrt_require_captcha' ) ) {
|
||||
$captcha_result = aksrt_require_captcha( $scene, wp_unslash( $_POST ) );
|
||||
if ( $captcha_result !== true ) {
|
||||
wp_send_json_error( array( 'message' => $captcha_result ) );
|
||||
}
|
||||
@@ -1113,8 +1113,8 @@ add_action('wp_ajax_aksrt_change_password', function () {
|
||||
}
|
||||
|
||||
// 人机验证
|
||||
if ( aksrt_is_captcha_enabled_for( 'change_password' ) ) {
|
||||
$captcha_result = aksrt_verify_captcha( $_POST );
|
||||
if ( function_exists( 'aksrt_require_captcha' ) ) {
|
||||
$captcha_result = aksrt_require_captcha( 'change_password', wp_unslash( $_POST ) );
|
||||
if ( $captcha_result !== true ) {
|
||||
wp_send_json_error( array( 'message' => $captcha_result ) );
|
||||
}
|
||||
@@ -1178,8 +1178,8 @@ add_action('wp_ajax_aksrt_change_email', function () {
|
||||
}
|
||||
|
||||
// 人机验证
|
||||
if ( aksrt_is_captcha_enabled_for( 'change_email' ) ) {
|
||||
$captcha_result = aksrt_verify_captcha( $_POST );
|
||||
if ( function_exists( 'aksrt_require_captcha' ) ) {
|
||||
$captcha_result = aksrt_require_captcha( 'change_email', wp_unslash( $_POST ) );
|
||||
if ( $captcha_result !== true ) {
|
||||
wp_send_json_error( array( 'message' => $captcha_result ) );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user