axios default withCredentials code example
Example 1: Axios withCredentials
import axios from 'axios'
axios.post(API_SERVER + '/login', { email, password }, { withCredentials: true })
Example 2: axios.defaults.withcredentials = true
const corsConfig = {
origin: true,
credentials: true,
};
app.use(cors(corsConfig));
app.options('*', cors(corsConfig));