withCredential 이란 서로 다른 origin에서 통신할 때 발생하는 CORS의 일종으로써 쿠키에 관련된 설정입니다.
토이 프로젝트 진행 중 게이트웨이의 CORS 설정을 모두 허용해줬음에도 브라우저의 쿠키가 자동으로 닮기지 않는 문제 발생하였습니다.
just-pickup.com:8081 (vue) -> just-pickup:8001 (api-gateway)
포트 번호가 다른 url 즉 다른 origin으로의 통신
브라우저

네트워크 패널

브라우저에서 확인되는 쿠키가 HTTP 통신 시 사라져버립니다.
쿠키야 어디로 사라진거니..😂
axios.defaults.withCredentials = true;
spring:
  application:
    name: owner-apigateway-service
  cloud:
    gateway:
      globalcors:
        cors-configurations:
          '[/**]':
            allowedOrigins: "http://just-pickup.com:8081"
            allowedMethods:
              - GET
              - POST
            allowedHeaders: '*'
            allow-credentials: true

"Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include” 에러가 발생합니다.