function assertCredentials(email: string, password: string) {
  if (!email.trim()) throw new Error("Email is required");
  if (!password.trim()) throw new Error("Password is required");
}

export const loginApi = async (email: string, password: string) => {
  assertCredentials(email, password);
  return `demo-token-${email.trim().toLowerCase()}`;
};

export const registerApi = async (email: string, password: string) => {
  assertCredentials(email, password);
  return `demo-token-${email.trim().toLowerCase()}`;
};
