Render authentication as a real gate
This commit is contained in:
parent
3e367c99cd
commit
f1d55b181a
3 changed files with 26 additions and 8 deletions
File diff suppressed because one or more lines are too long
2
web/dist/index.html
vendored
2
web/dist/index.html
vendored
|
|
@ -1,5 +1,5 @@
|
|||
<!doctype html>
|
||||
<html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>GhostlightDungeon</title> <script type="module" crossorigin src="/assets/index-D0cUnC_U.js"></script>
|
||||
<html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>GhostlightDungeon</title> <script type="module" crossorigin src="/assets/index-DmZm_kJC.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-DLoOYHpE.css">
|
||||
</head>
|
||||
<body><header><p class="eyebrow">STARFIRE / PRIVATE VERSE</p><h1>GhostlightDungeon</h1><p id="status" role="status" aria-live="polite">Reading the world…</p></header><main>
|
||||
|
|
|
|||
|
|
@ -76,9 +76,27 @@ function renderCommandReceipt(body: any) {
|
|||
showSummary("Command result", [body?.error ?? "The world returned no player-facing detail."]);
|
||||
}
|
||||
|
||||
function showAuthenticationGate() {
|
||||
const message = "This laboratory requires an unused invite link.";
|
||||
status.textContent = message;
|
||||
compiler.hidden = true;
|
||||
composer.hidden = true;
|
||||
destinationForm.hidden = true;
|
||||
campaignLab.hidden = true;
|
||||
receipt.hidden = true;
|
||||
host.hidden = false;
|
||||
const gate = node("article", undefined, "card");
|
||||
gate.append(
|
||||
node("h2", "Private campaign laboratory"),
|
||||
node("p", message),
|
||||
node("p", "Open one of the two single-use tester invitations on this device. The resulting session stays separate from the other player's campaigns.", "quiet"),
|
||||
);
|
||||
host.replaceChildren(gate);
|
||||
}
|
||||
|
||||
async function refresh() {
|
||||
const response = await fetch("/api/surface");
|
||||
if (response.status === 401) { status.textContent = "This laboratory requires an unused invite link."; return; }
|
||||
if (response.status === 401) { showAuthenticationGate(); return; }
|
||||
const surface = await response.json();
|
||||
const needsCompilation = surface.surface_id === "ghostlight.compiler";
|
||||
compiler.hidden = !needsCompilation; composer.hidden = needsCompilation; destinationForm.hidden = needsCompilation; host.hidden = needsCompilation; campaignLab.hidden = needsCompilation;
|
||||
|
|
|
|||
Loading…
Reference in a new issue