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

Function withRefreshedSession

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

Source from the content-addressed store, hash-verified

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