Hi @eerdag,
When I try to set it up again, I don’t see a QR code.
That’s because you already had Google Authenticator App configured. You will have to reset the Defender 2FA configuration for the user and the following workaround can help you with this.
<?php
// Defender deactivate 2auth for specific user
add_action( 'admin_init', function(){
if ( 'user_login' === wp_get_current_user()->user_login ) {
global $wp_filter;
$tag = 'current_screen';
$hook_method = 'maybe_redirect_to_show_2fa_enabler';
$hook_class = 'WP_Defender\\Controller\\Two_Factor';
if ( ! isset( $wp_filter[$tag] ) ) {
return;
}
foreach ( $wp_filter[$tag]->callbacks as $key => $callback_array ) {
foreach ( $callback_array as $c_key => $callback ) {
if ( substr_compare( $c_key, $hook_method, strlen( $c_key ) - strlen( $hook_method ), strlen( $hook_method ) ) === 0 ) {
if ( $callback['function'][0] instanceof $hook_class ){
unset( $wp_filter[$tag]->callbacks[$key][$c_key] );
}
}
}
}
}
} );
In the above code, please replace “user_login” with the username that you need to reset 2FA. Please add the code using a mu-plugin. You can find how to add a mu-plugin here in our documentation: https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins
I hope that helps. Please feel free to get back to us if you need any further assistance.
Kind Regards,
Nebu John