export enum LoginFailureReason {
  MISSING_CREDENTIALS = "MISSING_CREDENTIALS",
  INVALID_CREDENTIALS = "INVALID_CREDENTIALS",
  WRONG_PASSWORD = "WRONG_PASSWORD",
  ACCOUNT_LOCKED = "ACCOUNT_LOCKED",
  NOT_ACTIVATED = "NOT_ACTIVATED",
  NOT_ALLOWED = "NOT_ALLOWED",
  UNKNOWN = "UNKNOWN",
}

export const reasonLabel = (reason?: LoginFailureReason | string | null) => {
  switch (reason) {
    case "MISSING_CREDENTIALS":
      return "Missing credentials";
    case "INVALID_CREDENTIALS":
      return "Invalid credentials";
    case "WRONG_PASSWORD":
      return "Wrong password";
    case "ACCOUNT_LOCKED":
      return "Account locked";
    case "NOT_ACTIVATED":
      return "Account not activated";
    case "NOT_ALLOWED":
      return "Not allowed";
    case "UNKNOWN":
      return "Unknown";
    default:
      return null;
  }
};
