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) => {
  switch (reason) {
    case LoginFailureReason.MISSING_CREDENTIALS:
      return "Missing credentials";
    case LoginFailureReason.INVALID_CREDENTIALS:
      return "Invalid credentials";
    case LoginFailureReason.WRONG_PASSWORD:
      return "Wrong password";
    case LoginFailureReason.ACCOUNT_LOCKED:
      return "Account locked";
    case LoginFailureReason.NOT_ACTIVATED:
      return "Account not activated";
    case LoginFailureReason.NOT_ALLOWED:
      return "Not allowed";
    case LoginFailureReason.UNKNOWN:
      return "Unknown";
    default:
      return null;
  }
};
