/**
 * Format authentication error for display
 */
export const formatAuthError = (error: any): string => {
  if (typeof error === 'string') {
    return error;
  }

  if (error?.message) {
    return error.message;
  }

  if (error?.detail) {
    return error.detail;
  }

  if (error?.response?.data?.detail) {
    return error.response.data.detail;
  }

  return 'An unexpected error occurred';
};
