init_script.py python
34 lines 1.0 KB
Raw
sha256:8461d44b77376fbf06fa7c3e085d309e3010fd8d5886d63c63e69ce118811ad4 docs: record AFF-b feature-tip SHAs after AFF-b-ISR commit. Human 5 days ago
1 """Packaging-only Tauri initialization script for in-memory session bootstrap."""
2
3 from __future__ import annotations
4
5 import json
6
7
8 def build_auth_bootstrap_script(*, session_credential: str, csrf_token: str) -> str:
9 """Return JS that fills the Q1 auth panel without persisting secrets."""
10 session_json = json.dumps(session_credential)
11 csrf_json = json.dumps(csrf_token)
12 return f"""
13 (function() {{
14 const session = {session_json};
15 const csrf = {csrf_json};
16 function bootstrap() {{
17 const sessionInput = document.getElementById("session-input");
18 const csrfInput = document.getElementById("csrf-input");
19 const saveButton = document.getElementById("auth-save");
20 if (!sessionInput || !csrfInput || !saveButton) {{
21 setTimeout(bootstrap, 50);
22 return;
23 }}
24 sessionInput.value = session;
25 csrfInput.value = csrf;
26 saveButton.click();
27 }}
28 if (document.readyState === "loading") {{
29 document.addEventListener("DOMContentLoaded", bootstrap);
30 }} else {{
31 bootstrap();
32 }}
33 }})();
34 """.strip()
File History 1 commit
sha256:8461d44b77376fbf06fa7c3e085d309e3010fd8d5886d63c63e69ce118811ad4 docs: record AFF-b feature-tip SHAs after AFF-b-ISR commit. Human 5 days ago