export const authService = () => {
  return {
    async checkAuth() {
      const response = await fetch('/api/account', {
        headers: {
          'X-Requested-With': 'XMLHttpRequest'
        }
      });

      if (!response.ok) return { isAuthenticated: false };
      const data = await response.json();
      return { isAuthenticated: !!data.authorities, data };
    }
  };
};
