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



export default async function login(email: string, password: string) {
  const csrfToken: string = await getXSRFToken();
  return fetchWrapper(
    "/api/users/login",
    { email, password },
    "POST",
    { "X-XSRF-TOKEN": csrfToken }
  );
}