@tokenoftrust/storefront-runner 7.7.2 → 7.7.3
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.
|
@@ -123,8 +123,15 @@ export async function getVerifier(resource: string): Promise<IdentityAssertionVe
|
|
|
123
123
|
|
|
124
124
|
export { getVerifier as getIdentityVerifier };
|
|
125
125
|
|
|
126
|
-
/** Set the session cookie (HttpOnly/Secure/SameSite=Lax) for `maxAgeSeconds`.
|
|
127
|
-
|
|
126
|
+
/** Set the session cookie (HttpOnly/Secure/SameSite=Lax) for `maxAgeSeconds`.
|
|
127
|
+
* Pass the updated `session` record when rotating an in-flight session so downstream
|
|
128
|
+
* `readViewerSession` / `resolveRequestPrincipal` calls on the same request see it. */
|
|
129
|
+
export function setSessionCookie(
|
|
130
|
+
context: APIContext,
|
|
131
|
+
id: string,
|
|
132
|
+
maxAgeSeconds: number,
|
|
133
|
+
session?: SessionRecord,
|
|
134
|
+
): void {
|
|
128
135
|
context.cookies.set(SESSION_COOKIE, id, {
|
|
129
136
|
httpOnly: true,
|
|
130
137
|
secure: true,
|
|
@@ -132,11 +139,13 @@ export function setSessionCookie(context: APIContext, id: string, maxAgeSeconds:
|
|
|
132
139
|
path: "/",
|
|
133
140
|
maxAge: maxAgeSeconds,
|
|
134
141
|
});
|
|
142
|
+
if (session) rememberRequestViewerSession(context, session);
|
|
135
143
|
}
|
|
136
144
|
|
|
137
145
|
/** Clear the session cookie (logout). */
|
|
138
146
|
export function clearSessionCookie(context: APIContext): void {
|
|
139
147
|
context.cookies.delete(SESSION_COOKIE, { path: "/" });
|
|
148
|
+
if (context.request) inRequestViewerSessions.delete(context.request);
|
|
140
149
|
}
|
|
141
150
|
|
|
142
151
|
export { safeNext } from "./safeNext.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenoftrust/storefront-runner",
|
|
3
|
-
"version": "7.7.
|
|
3
|
+
"version": "7.7.3",
|
|
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",
|