feat(chat): share a chat by link — anonymous read-only /shared/<token> page, share/unshare
This commit is contained in:
@@ -424,7 +424,12 @@ def test_init_shared_header_rewrites_sign_in_next_to_current_page() -> None:
|
||||
"""Phase 34 task 02: initSharedHeader points #sign-in-link at
|
||||
/login.html?next=<current pathname> (default "/") — the admin lands
|
||||
back on the page they signed in from. The page markup keeps its own
|
||||
static ?next= as the no-JS fallback."""
|
||||
static ?next= as the no-JS fallback.
|
||||
|
||||
Phase 51 (owner-locked 2026-08-29, TODO.md L6): the ONE exception —
|
||||
the NESTED /shared/<token> page rewrites to the APP ROOT ("/")
|
||||
instead of the shared URL: a guest signing in from a shared page
|
||||
returns to the app root, not to a public link."""
|
||||
js = _text(HEADER_JS)
|
||||
fn = js.find("function initSharedHeader")
|
||||
assert fn != -1
|
||||
@@ -432,7 +437,10 @@ def test_init_shared_header_rewrites_sign_in_next_to_current_page() -> None:
|
||||
# raw pathname (always a query-safe "/…" string — never "//", and ?
|
||||
# # / spaces stay percent-encoded inside it; login.js safeNext
|
||||
# re-validates), same shape as the static markup fallbacks
|
||||
assert '"/login.html?next=" + (window.location.pathname || "/")' in body
|
||||
assert 'const nextPath = window.location.pathname || "/";' in body
|
||||
assert 'link.href = "/login.html?next=" + signInNext;' in body
|
||||
# the shared-page exception: /shared/<token> → the app root
|
||||
assert 'nextPath.startsWith("/shared/") ? "/" : nextPath' in body
|
||||
|
||||
|
||||
# ---------- phase 34 task 01: the steering controls move to the module ----------
|
||||
|
||||
Reference in New Issue
Block a user