let url_Backend_dwinzo = `http://${process.env.REACT_APP_SERVER_REST_API_BASE_URL}`;

export const signInApi = async (Email: string, Password: Object, organization: Object, fingerprint: any) => {
  try {
    const response = await fetch(`${url_Backend_dwinzo}/api/V1/Auth/login`, {
      method: "POST",
      headers: { "Content-Type": "application/json", },
      body: JSON.stringify({ Email, Password, organization, fingerprint }),
    });

    const result = await response.json();

    return result;
  } catch (error) {
    echo.error("Failed to sign-in");
    if (error instanceof Error) {
      return { error: error.message };
    } else {
      return { error: "An unknown error occurred" };
    }
  }
};
