To make it work simply do
import axios from "axios";
const Axios = axios.create({
baseURL:
process.env.NODE_ENV === "development"
? process.env.REACT_APP_DEV_SERVER_URL
: process.env.REACT_APP_SERVER_URL,
});
Axios.defaults.withCredentials = true;
export default Axios;
or
just
import axios from "axios";
axios.defaults.withCredentials = true;
It makes axios store cookies
Thanks for reading, hearts ❤️ if you liked it and unicorns 🦄 if you loved it, follow if you wanna read more awesome blogs
Top comments (0)