Skip to content

Commit

Permalink
Focus in code input when totp is checked
Browse files Browse the repository at this point in the history
  • Loading branch information
thrijith committed Oct 24, 2024
1 parent 6a95e7f commit 7ce0634
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions providers/class-two-factor-totp.php
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,13 @@ public function user_two_factor_options( $user ) {

<script>
(function($){
// Focus the auth code input when the checkbox is clicked.
document.getElementById('enabled-Two_Factor_Totp').addEventListener('click', function(e) {
if ( e.target.checked ) {
document.getElementById('two-factor-totp-augthcode').focus();
}
});

$('.totp-submit').click( function( e ) {
e.preventDefault();
var key = $('#two-factor-totp-key').val(),
Expand Down

0 comments on commit 7ce0634

Please sign in to comment.