This commit is contained in:
2026-08-20 09:39:20 +02:00
parent 13547fb083
commit 7108d446d8
8 changed files with 137 additions and 16 deletions

View File

@ -57,6 +57,12 @@ button:hover { filter: brightness(1.1); }
.qr { display: block; margin: 1rem auto; border-radius: 6px; }
.recovery-codes { font-family: monospace; background: #0f1218; padding: 0.75rem; border-radius: 6px; }
/* Sichtbarkeits-Toggle ohne Inline-Styles -- CSP (style-src 'self', kein
'unsafe-inline') blockt sowohl style="..."-Attribute in Markup als auch
per JS gesetzte element.style-Aenderungen. Toggle daher ausschliesslich
ueber diese Klasse (siehe login.js / terminal.js / rdp.js). */
.hidden { display: none !important; }
.topbar {
display: flex; align-items: center; justify-content: space-between;
padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--border); background: var(--panel);

View File

@ -41,14 +41,14 @@
const result = await postJson("/auth/login", { username, password });
pendingToken = result.pending_token;
passwordFields.style.display = "none";
totpFields.style.display = "block";
passwordFields.classList.add("hidden");
totpFields.classList.remove("hidden");
if (!result.totp_enrolled) {
mode = "enroll_start";
const enroll = await postJson("/auth/totp/enroll/start", { pending_token: pendingToken });
document.getElementById("qr-img").src = "data:image/png;base64," + enroll.qr_png_base64;
enrollBox.style.display = "block";
enrollBox.classList.remove("hidden");
mode = "enroll_confirm";
submitBtn.textContent = "TOTP bestaetigen & einrichten";
} else {
@ -68,7 +68,7 @@
if (mode === "enroll_confirm") {
const code = document.getElementById("totp-code").value.trim();
const result = await postJson("/auth/totp/enroll/confirm", { pending_token: pendingToken, code });
recoveryBox.style.display = "block";
recoveryBox.classList.remove("hidden");
document.getElementById("recovery-codes").textContent = result.recovery_codes.join("\n");
submitBtn.textContent = "Weiter zum Dashboard";
mode = "done";

View File

@ -11,9 +11,9 @@
(() => {
"use strict";
const hostId = window.JUMPHOST_HOST_ID;
const statusEl = document.getElementById("status");
const shell = document.getElementById("session-shell");
const hostId = shell.dataset.hostId;
const statusEl = document.getElementById("status");
const displayDiv = document.getElementById("rdp-display");
const proto = window.location.protocol === "https:" ? "wss:" : "ws:";

View File

@ -9,9 +9,9 @@
(() => {
"use strict";
const hostId = window.JUMPHOST_HOST_ID;
const statusEl = document.getElementById("status");
const shell = document.getElementById("session-shell");
const hostId = shell.dataset.hostId;
const statusEl = document.getElementById("status");
const term = new Terminal({
cursorBlink: true,