Open JaeYeopHan opened 3 years ago
https://github.com/chimurai/http-proxy-middleware
withCredential 옵션과는 상관없이 cookie에 접근할 수 없다. (cookie domain이 localhost가 아니라) cookieDomainRewrite로 {강제된 domain address} 를 localhost로 rewrite 해주자.
cookieDomainRewrite
{강제된 domain address}
const { createProxyMiddleware } = require('http-proxy-middleware'); server.use( '/api/auth', createProxyMiddleware({ changeOrigin: true, target: {Target API address}, cookieDomainRewrite: { {강제된 domain address}: 'localhost', }, }) );
https://github.com/chimurai/http-proxy-middleware
Situation 1: 인증 서버에서 cookie domain을 강제했을 경우,
withCredential 옵션과는 상관없이 cookie에 접근할 수 없다. (cookie domain이 localhost가 아니라)
cookieDomainRewrite
로{강제된 domain address}
를 localhost로 rewrite 해주자.