From 8b7f35f2fbc7bcf4f10eafa4c2d9a6c3580afadc Mon Sep 17 00:00:00 2001 From: Deepak Pradhan Date: Thu, 15 Feb 2024 12:48:41 +0545 Subject: [PATCH] fix:added interceptor for cookie issue --- src/frontend/src/App.jsx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/App.jsx b/src/frontend/src/App.jsx index bb2568acb3..2aa63748a9 100755 --- a/src/frontend/src/App.jsx +++ b/src/frontend/src/App.jsx @@ -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');