Reformat all project files to use the prettier config file.
This commit is contained in:
@@ -1,26 +1,22 @@
|
||||
import axios from "axios";
|
||||
import {auth} from "../firebase/firebase.utils";
|
||||
import { auth } from "../firebase/firebase.utils";
|
||||
|
||||
axios.defaults.baseURL =
|
||||
import.meta.env.VITE_APP_AXIOS_BASE_API_URL ||
|
||||
(
|
||||
import.meta.env.MODE === "production" ?
|
||||
"https://api.imex.online/" :
|
||||
"http://localhost:4000/"
|
||||
);
|
||||
import.meta.env.VITE_APP_AXIOS_BASE_API_URL ||
|
||||
(import.meta.env.MODE === "production" ? "https://api.imex.online/" : "http://localhost:4000/");
|
||||
|
||||
export const axiosAuthInterceptorId = axios.interceptors.request.use(
|
||||
async (config) => {
|
||||
if (!config.headers.Authorization) {
|
||||
const token = auth.currentUser && (await auth.currentUser.getIdToken());
|
||||
if (token) {
|
||||
config.headers.Authorization = `Bearer ${token}`;
|
||||
}
|
||||
}
|
||||
async (config) => {
|
||||
if (!config.headers.Authorization) {
|
||||
const token = auth.currentUser && (await auth.currentUser.getIdToken());
|
||||
if (token) {
|
||||
config.headers.Authorization = `Bearer ${token}`;
|
||||
}
|
||||
}
|
||||
|
||||
return config;
|
||||
},
|
||||
(error) => Promise.reject(error)
|
||||
return config;
|
||||
},
|
||||
(error) => Promise.reject(error)
|
||||
);
|
||||
|
||||
const cleanAxios = axios.create();
|
||||
|
||||
Reference in New Issue
Block a user