Skip to content

Commit

Permalink
fix:added interceptor for cookie issue
Browse files Browse the repository at this point in the history
  • Loading branch information
varun2948 committed Feb 15, 2024
1 parent 76ebcc9 commit 8b7f35f
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/frontend/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,24 @@ console.error = function filterWarnings(msg, ...args) {
consoleError(msg, ...args);
}
};

axios.interceptors.request.use(
(config) => {
// Do something before request is sent

// const excludedDomains = ['xxx', 'xxx'];
// const urlIsExcluded = excludedDomains.some((domain) => config.url.includes(domain));
// if (!urlIsExcluded) {
// config.withCredentials = true;
// }

config.withCredentials = true;

return config;
},
(error) =>
// Do something with request error
Promise.reject(error),
);
const GlobalInit = () => {
useEffect(() => {
console.log('adding interceptors');
Expand Down

0 comments on commit 8b7f35f

Please sign in to comment.