This commit is contained in:
bwnyasse
2026-01-10 21:22:35 -05:00
parent 90455d9181
commit d43a14ee0c
116 changed files with 41323 additions and 19 deletions

View File

@@ -0,0 +1,22 @@
import axios from "axios";
import { auth } from "../firebase";
const apiClient = axios.create({
baseURL: import.meta.env.VITE_API_BASE_URL, // You will need to add this to your .env file
});
apiClient.interceptors.request.use(
async (config) => {
const user = auth.currentUser;
if (user) {
const token = await user.getIdToken();
config.headers.Authorization = `Bearer ${token}`;
}
return config;
},
(error) => {
return Promise.reject(error);
}
);
export default apiClient;