@tokenoftrust/storefront-runner 6.12.10 → 6.12.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* `tot_preview` cookies), shared by every middleware layer that consults it: the
|
|
4
4
|
* front door's static passthrough and mirror stage, the control-plane gate, and the
|
|
5
5
|
* render chain. A presented context is verified by `requireValidPreviewToken` and
|
|
6
|
-
* never degrades to "absent"; the control plane and the render chain refuse it with
|
|
6
|
+
* never degrades to "absent" (except a cookie-only expired token, below); the control plane and the render chain refuse it with
|
|
7
7
|
* `previewContextRefusalResponse` before any publication, page-cache, rewrite-target
|
|
8
8
|
* or source resolution.
|
|
9
9
|
*
|
|
@@ -61,6 +61,13 @@ export async function resolveRequestPreviewContext(
|
|
|
61
61
|
secret: input.secret,
|
|
62
62
|
nowSeconds: input.nowSeconds,
|
|
63
63
|
});
|
|
64
|
+
// A `tot_preview` cookie alone that has merely expired grants nothing and proves no
|
|
65
|
+
// tampering: it reads as absent, so the viewer falls back to session or public
|
|
66
|
+
// access instead of a dead-end 403. Any presented `__preview` query value, and every
|
|
67
|
+
// other refusal (bad signature, wrong tenant, ambiguity), still refuses.
|
|
68
|
+
if (context.status === "refused" && context.reason === "expired" && queryValues.length === 0) {
|
|
69
|
+
return { context: { status: "absent" }, presented, cookieValue: null };
|
|
70
|
+
}
|
|
64
71
|
if (
|
|
65
72
|
context.status === "refused" &&
|
|
66
73
|
(isPreviewDispatcherPath(input.url.pathname) || isAuthPath(input.renderPath))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenoftrust/storefront-runner",
|
|
3
|
-
"version": "6.12.
|
|
3
|
+
"version": "6.12.11",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"description": "World-shareable storefront runner: multi-tenant renderer on Astro/Cloudflare. No control plane.",
|
|
6
6
|
"packageManager": "pnpm@11.9.0",
|