From a8a6c4aabbb169d0a716410f7bca5bfda022d11f Mon Sep 17 00:00:00 2001 From: Kaspars Dambis Date: Thu, 19 Sep 2024 15:17:37 +0300 Subject: [PATCH] Toggle the checkbox outside of the control panel --- providers/class-two-factor-totp.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/providers/class-two-factor-totp.php b/providers/class-two-factor-totp.php index 99786bd3..74f0f2e6 100644 --- a/providers/class-two-factor-totp.php +++ b/providers/class-two-factor-totp.php @@ -384,8 +384,10 @@ public function user_two_factor_options( $user ) { $error.find('p').text( errorMessage ); + $( '#enabled-Two_Factor_Totp' ).prop( 'checked', false ); $('#two-factor-totp-authcode').val(''); } ).then( function( response ) { + $( '#enabled-Two_Factor_Totp' ).prop( 'checked', true ); $( '#two-factor-totp-options' ).html( response.html ); } ); } ); @@ -412,6 +414,7 @@ public function user_two_factor_options( $user ) { user_id: ID ); ?>, } } ).then( function( response ) { + $( '#enabled-Two_Factor_Totp' ).prop( 'checked', false ); $( '#two-factor-totp-options' ).html( response.html ); } ); } );