(username, password)
| 274 | } |
| 275 | |
| 276 | export async function login(username, password) { |
| 277 | return fetch("/api/auth", { |
| 278 | method: "POST", |
| 279 | headers: { |
| 280 | "X-CSRFToken": getCsrfToken(), |
| 281 | "Content-Type": "application/json", |
| 282 | }, |
| 283 | credentials: "same-origin", |
| 284 | mode: "same-origin", |
| 285 | cache: "no-cache", |
| 286 | redirect: "error", |
| 287 | body: JSON.stringify({ username, password }), |
| 288 | }).then(processJsonResponse); |
| 289 | } |
| 290 | |
| 291 | export async function logout() { |
| 292 | return fetch("/api/logout", { |
nothing calls this directly
no test coverage detected