diff options
author | Mario <mario@mariovavti.com> | 2023-03-11 20:40:32 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2023-03-11 20:40:32 +0000 |
commit | 5fada6a497ad5123668f282deb508db00e628bda (patch) | |
tree | 8f43705d1a5bb345df1c17dbad5ce4afd6c98c17 /view/tpl | |
parent | ac9c33fb3b31f4a3801fbdf7c723b923d699964d (diff) | |
download | volse-hubzilla-5fada6a497ad5123668f282deb508db00e628bda.tar.gz volse-hubzilla-5fada6a497ad5123668f282deb508db00e628bda.tar.bz2 volse-hubzilla-5fada6a497ad5123668f282deb508db00e628bda.zip |
more strings and provide mfa feedback via jgrowl
Diffstat (limited to 'view/tpl')
-rw-r--r-- | view/tpl/totp_setup.tpl | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/view/tpl/totp_setup.tpl b/view/tpl/totp_setup.tpl index 1301d0001..6f995edf1 100644 --- a/view/tpl/totp_setup.tpl +++ b/view/tpl/totp_setup.tpl @@ -20,9 +20,6 @@ <button id="otp-test-submit" type="submit" name="submit" class="btn btn-outline-primary" onclick="totp_test_code(); return false;"> {{$test}} </button> - <div class=""> - <strong id="otptest_results"></strong> - </div> </form> </div> <div id="mfa-submit-wrapper" class="{{if !$enable_mfa.2}}d-none{{/if}}"> @@ -42,10 +39,9 @@ <script> function totp_clear_code() { - let box = document.getElementById("totp_test"); - box.value = ""; + let box = document.getElementById('totp_test'); + box.value = ''; box.focus(); - document.getElementById("otptest_results").innerHTML = ""; } function totp_test_code() { @@ -53,11 +49,13 @@ 'totp_check', {totp_code: document.getElementById('totp_test').value}, function(data) { - document.getElementById("otptest_results").innerHTML = data['status'] ? '{{$test_pass}}' : '{{$test_fail}}'; if (data['status']) { + $.jGrowl('{{$test_pass}}', { sticky: false, theme: 'info', life: 10000 }); let e = document.getElementById('mfa-submit-wrapper'); e.classList.remove('d-none'); + return; } + $.jGrowl('{{$test_fail}}', { sticky: false, theme: 'notice', life: 10000 }); } ); } |