MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / passwordPage

Function passwordPage

packages/ci-proxy-worker/src/index.ts:375–401  ·  view source on GitHub ↗
(
  session: EncodedSession,
  encoded: string,
  error: string,
  status = 200,
)

Source from the content-addressed store, hash-verified

373}
374
375function passwordPage(
376 session: EncodedSession,
377 encoded: string,
378 error: string,
379 status = 200,
380): Response {
381 const details = [
382 session.repo ? escapeHtml(session.repo) : "",
383 session.pr ? `PR #${escapeHtml(session.pr)}` : "",
384 session.platform ? escapeHtml(session.platform) : "",
385 ]
386 .filter(Boolean)
387 .join(" · ");
388 const body = `
389 ${details ? `<p class="details">${details}</p>` : ""}
390 ${error ? `<p class="error">${escapeHtml(error)}</p>` : ""}
391 <form method="post" action="/api/session/auth">
392 <input type="hidden" name="${REDIRECT_PARAM}" value="${escapeHtml(encoded)}" />
393 <label>
394 Session password
395 <input name="password" type="password" autocomplete="current-password" autofocus />
396 </label>
397 <button type="submit">Open SimDeck</button>
398 </form>
399 `;
400 return passwordShellResponse("Protected SimDeck session", body, status);
401}
402
403function landingPage(): Response {
404 return passwordShellResponse(

Callers 2

handleRequestFunction · 0.85
authenticateSessionFunction · 0.85

Calls 2

passwordShellResponseFunction · 0.85
escapeHtmlFunction · 0.70

Tested by

no test coverage detected