import fetchWrapper from "../fetchWrapper.js";
import getXSRFToken from "../getXSRF.js";

export default async function login(email, password) {
    const csrfToken = await getXSRFToken();

    return fetchWrapper(
        "/api/users/login",
        { email, password },
        "POST",
        { "X-XSRF-TOKEN": csrfToken }
    );
}
