import axios from "axios";
import Cookies from "js-cookie";

export const presignedAxios = axios.create({
  headers: {},
  transformRequest: [(data) => data],
  validateStatus: (s) => s < 400,
});

presignedAxios.interceptors.request.use((config) => {
  const token = Cookies.get("auth-token");
  if (token) {
    config.headers["Authorization"] = `Bearer ${token}`;
  }
  return config;
});
