(email: string)
| 86 | const json = async (res: Response) => (await res.json()) as Record<string, unknown>; |
| 87 | |
| 88 | const signUp = async (email: string): Promise<string> => { |
| 89 | const inviteCode = await mintInviteCode(handler); |
| 90 | const res = await handler( |
| 91 | new Request(`${BASE}/api/auth/sign-up/email`, { |
| 92 | method: "POST", |
| 93 | headers: { "content-type": "application/json" }, |
| 94 | body: JSON.stringify({ email, password: "password-12345678", name: email, inviteCode }), |
| 95 | }), |
| 96 | ); |
| 97 | expect(res.status).toBe(200); |
| 98 | // The session cookie lets /mcp/authorize skip the interactive login. |
| 99 | return res.headers.get("set-cookie") ?? ""; |
| 100 | }; |
| 101 | |
| 102 | const b64url = (buf: Uint8Array): string => |
| 103 | btoa(String.fromCharCode(...buf)) |
no test coverage detected