Skip to content

Commit

Permalink
Merge pull request #645 from thrijith/feature/update-ux-totp
Browse files Browse the repository at this point in the history
Focus in code input when totp is checked
  • Loading branch information
kasparsd authored Dec 2, 2024
2 parents 100587e + 8c029af commit 636dc0b
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-authcode').focus();
}
});

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

0 comments on commit 636dc0b

Please sign in to comment.