import { createApiClient } from "hse-auth";

const api = createApiClient({
  baseURL: import.meta.env.VITE_API_BASE_URL || "/api/swi",
});

api.interceptors.request.use((config) => {
  config.headers["Content-Type"] = "application/json";
  return config;
});

export {
  getStoredAuth,
  setStoredAuth,
  clearStoredAuth as logout,
  AUTH_STORAGE_KEY,
} from "hse-auth";

export default api;
