MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / browserCookies

Function browserCookies

e2e/cloud/support/admin-mfa.ts:35–49  ·  view source on GitHub ↗
(cookie: string)

Source from the content-addressed store, hash-verified

33
34/** Read all cookie pairs, including admin verification, into browser fixtures. */
35export const browserCookies = (cookie: string): NonNullable<Identity["cookies"]> =>
36 cookie
37 .split(";")
38 .map((pair) => pair.trim())
39 .filter(Boolean)
40 .map((pair) => {
41 const separator = pair.indexOf("=");
42 if (separator < 1) throw new Error("Invalid test cookie");
43 const name = pair.slice(0, separator);
44 return {
45 name,
46 value: pair.slice(separator + 1),
47 ...(name.startsWith("__Host-") ? { secure: true } : {}),
48 };
49 });
50
51/** Verify a test admin through the product, retaining the test authenticator for later sign-ins. */
52export const verifyAdmin = (baseUrl: string, identity: Identity): Effect.Effect<Identity> =>

Callers 2

responseCookiesFunction · 0.85
verifyAdminFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected