Skip to content

Commit

Permalink
Merge pull request #26 from humhub/fix/25-double-qr-code-after-cancel…
Browse files Browse the repository at this point in the history
…-new-request-code

Fix double rendering QR code after cancel of requesting new code
  • Loading branch information
luke- authored May 19, 2021
2 parents 861230a + b65a657 commit 412fac4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog
1.0.4 (Unreleased)
--------------------
- Fix #23: Urlencode account name in otpauth URL
- Fix #25: Fix double rendering QR code after cancel of requesting new code

1.0.3 (May 11, 2021)
--------------------
Expand Down
14 changes: 8 additions & 6 deletions views/config/userGoogleAuthenticatorCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@

<script>
$(document).ready(function(){
new QRCode('twofa-google-auth-qrcode', {
text: '<?= $qrCodeText ?>',
width: 300,
height: 300,
correctLevel: QRCode.CorrectLevel.L
});
if ($('#twofa-google-auth-qrcode').html() === '') {
new QRCode('twofa-google-auth-qrcode', {
text: '<?= $qrCodeText ?>',
width: 300,
height: 300,
correctLevel: QRCode.CorrectLevel.L
});
}
<?php if ($requirePinCode) : ?>
$('#twofaGoogleAuthPinCode').show();
$('input[name="GoogleAuthenticatorUserSettings[changeSecretCode]"]').val(1);
Expand Down

0 comments on commit 412fac4

Please sign in to comment.