/**
 * Development Authentication Configuration
 * Simplified auth setup for easier development and debugging
 */

export interface DevAuthConfig {
  disableCsrf: boolean;
  disableRateLimit: boolean;
  disableAccountLocking: boolean;
  enableDebugLogs: boolean;
  simplifiedErrorMessages: boolean;
}

export const createDevAuthConfig = (): DevAuthConfig => {
  const isDevelopment = process.env.NODE_ENV !== "production";

  return {
    // Disable CSRF protection in development for easier testing
    disableCsrf: isDevelopment && process.env.DISABLE_CSRF === "true",

    // Disable rate limiting in development
    disableRateLimit: isDevelopment && process.env.DISABLE_RATE_LIMIT === "true",

    // Disable account locking in development
    disableAccountLocking: isDevelopment && process.env.DISABLE_ACCOUNT_LOCKING === "true",

    // Enable debug logs in development
    enableDebugLogs: isDevelopment,

    // Show detailed error messages in development
    simplifiedErrorMessages: isDevelopment,
  };
};

export const devAuthConfig = createDevAuthConfig();
