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

Function withRefreshedSession

e2e/cloud/spec-update-convergence.test.ts:132–145  ·  view source on GitHub ↗
(
  identity: Identity,
  response: Response,
  orgSelector: string,
)

Source from the content-addressed store, hash-verified

130 });
131
132const withRefreshedSession = (
133 identity: Identity,
134 response: Response,
135 orgSelector: string,
136): Identity => {
137 const refreshed = (response.headers.getSetCookie?.() ?? [])
138 .find((header) => header.startsWith("wos-session="))
139 ?.split(";")[0];
140 if (!refreshed) throw new Error("response did not refresh the session cookie");
141 return {
142 ...identity,
143 headers: { cookie: refreshed, [ORG_SELECTOR_HEADER]: orgSelector },
144 };
145};
146
147/** Invite `member` into `admin`'s org and accept — the real invite flow.
148 * The member's requests inherit the admin's org selector (org-scoped reads

Callers 1

joinOrgFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected