testComingBackStaysOnTheSite
After signing in, the registry goes back only to a path of its own.
import { comingBack } from "#codebase/tcmts/registry/session"; import assert from "node:assert/strict"; export const testComingBackStaysOnTheSite = () => { assert.equal(comingBack("/@alice.dev/geo?tab=code", "/"), "/@alice.dev/geo?tab=code"); for (const away of [ "//evil.example/", "/\\evil.example", "https://evil.example", "javascript:x", null, ]) assert.equal(comingBack(away, "/home"), "/home", String(away)); }