Skip to content

Commit

Permalink
TOTP: Remove older class methods no longer available.
Browse files Browse the repository at this point in the history
In two-factor v0.8, a bunch of class methods and constants were
removed as part of the overhaul to use the REST API instead of AJAX.
See WordPress/two-factor#504.

This broke our custom, frontend implementation handler. More to come.

See #1.
  • Loading branch information
r-a-y committed Apr 26, 2023
1 parent 5b751d0 commit 3f59010
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions hooks/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,6 @@ function validate() {
Two_Factor_Core::user_two_factor_options_update( $object_id );
}
}, 10, 3 );

// Secret key save routine.
$totp->user_two_factor_options_update( $user_id );

$notices = get_user_meta( $user_id, $totp::NOTICES_META_KEY, true );

// Error.
if ( ! empty( $notices['error'] ) ) {
delete_user_meta( $user_id, $totp::NOTICES_META_KEY );
bp_core_add_message( implode( "\n", $notices['error'] ), 'error' );
bp_core_redirect( $redirect );

// Success.
} elseif ( isset( $_POST['_nonce_user_two_factor_totp_options'] ) && ! empty( $_POST['two-factor-totp-authcode'] ) && ! empty( $_POST['two-factor-totp-key'] ) ) {
bp_core_add_message( esc_html__( 'Two-factor authentication option saved', 'bp-two-factor' ) );
bp_core_redirect( $redirect );
}
}

// U2F.
Expand Down

0 comments on commit 3f59010

Please sign in to comment.