(email: string, firstName: string)
| 32 | }).then((r) => r.json() as Promise<{ client_id: string; client_secret: string }>); |
| 33 | |
| 34 | const createIdpUser = (email: string, firstName: string) => |
| 35 | fetch(`${idp.url}/api/v1/users`, { |
| 36 | method: "POST", |
| 37 | headers: { "content-type": "application/json", authorization: "SSWS test" }, |
| 38 | body: JSON.stringify({ profile: { login: email, email, firstName, lastName: "User" } }), |
| 39 | }); |
| 40 | await createIdpUser("alice@example.com", "Alice"); |
| 41 | await createIdpUser("mallory@evil.test", "Mallory"); |
| 42 |