diff --git a/app-code/account/index.php b/app-code/account/index.php
index be99ca8..c419c18 100644
--- a/app-code/account/index.php
+++ b/app-code/account/index.php
@@ -28,6 +28,16 @@ if (!isset($_SESSION["logged_in"]) || $_SESSION["logged_in"] !== true) {
.modal-backdrop.modal-front-backdrop {
z-index: 1060;
}
+ .qr-wrap {
+ display: inline-block;
+ background: #fff;
+ padding: 16px;
+ margin: 0 16px 16px;
+ border-radius: 6px;
+ }
+ .qr-secret {
+ margin: 0 16px 16px;
+ }
@@ -199,7 +209,18 @@ if (!isset($_SESSION["logged_in"]) || $_SESSION["logged_in"] !== true) {
-
+
+
@@ -458,12 +479,24 @@ if (!isset($_SESSION["logged_in"]) || $_SESSION["logged_in"] !== true) {
function show2FaModal(message,secret) {
document.getElementById('twofaModalMessage').textContent = message;
document.getElementById('qrcode').innerHTML = '';
+ document.getElementById('twofa-secret').value = secret;
document.getElementById('twofa-confirm-pin').value = '';
const errorModal = new bootstrap.Modal(document.getElementById('twofaModal'));
generate2FAQRCode("Jakach Login",'',secret);
errorModal.show();
}
+ async function copy2FaSecret() {
+ const secretInput = document.getElementById('twofa-secret');
+ secretInput.select();
+ secretInput.setSelectionRange(0, secretInput.value.length);
+ if (navigator.clipboard) {
+ await navigator.clipboard.writeText(secretInput.value);
+ } else {
+ document.execCommand('copy');
+ }
+ }
+
async function confirm2FaEnrollment() {
const pin = document.getElementById('twofa-confirm-pin').value.trim();
if (!pin) {