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

Function signInToken

apps/host-selfhost/src/testing/mint-invite.ts:19–30  ·  view source on GitHub ↗
(handler: Handler, email: string, password: string)

Source from the content-addressed store, hash-verified

17const BASE = "http://localhost:4788/api";
18
19const signInToken = async (handler: Handler, email: string, password: string): Promise<string> => {
20 const response = await handler(
21 new Request("http://localhost:4788/api/auth/sign-in/email", {
22 method: "POST",
23 headers: { "content-type": "application/json" },
24 body: JSON.stringify({ email, password }),
25 }),
26 );
27 const token = response.headers.get("set-auth-token");
28 assert(response.ok && token, `Test admin sign-in failed (${response.status}).`);
29 return token;
30};
31
32// A FetchHttpClient backed by the in-process handler, carrying the admin bearer.
33const clientLayer = (handler: Handler, token: string) =>

Callers 1

createInviteMinterFunction · 0.85

Calls 3

assertFunction · 0.85
getMethod · 0.65
handlerFunction · 0.50

Tested by

no test coverage detected