diff --git a/datahub-web-react/src/setupProxy.js b/datahub-web-react/src/setupProxy.js index b084d6deefe79c..478c015705a138 100644 --- a/datahub-web-react/src/setupProxy.js +++ b/datahub-web-react/src/setupProxy.js @@ -1,3 +1,7 @@ +const logInFilter = function (pathname, req) { + return pathname.match('^/logIn') && req.method === 'POST'; +}; + if (process.env.REACT_APP_MOCK === 'true' || process.env.REACT_APP_MOCK === 'cy') { // no proxy needed, MirageJS will intercept all http requests module.exports = function () {}; @@ -8,7 +12,7 @@ if (process.env.REACT_APP_MOCK === 'true' || process.env.REACT_APP_MOCK === 'cy' module.exports = function (app) { app.use( '/logIn', - createProxyMiddleware({ + createProxyMiddleware(logInFilter, { target: 'http://localhost:9002', changeOrigin: true, }),