(path, body)
| 42 | async function authRequest(path, body) { |
| 43 | return fetch(path, { |
| 44 | method: "POST", |
| 45 | credentials: "include", |
| 46 | headers: {'Content-Type': 'application/json'}, |
| 47 | ...(body && {body: JSON.stringify(body)}), |
| 48 | }); |
| 49 | } |
| 50 | |
| 51 | export async function login(email, password) { |
| 52 | const normalizedEmail = email.trim().toLowerCase(); |
| 53 | const username = normalizedEmail.split('@')[0]; |
| 54 | const response = await authRequest(LOGIN, {email: normalizedEmail, password}); |
no outgoing calls
no test coverage detected