I created my server to use authentication with cookies. And when I try to include cookies in the apollo sandbox setting, The browser console log the following errors.
Access to fetch at 'http://localhost:4050/graphql' from origin 'https://studio.apollographql.com' has been blocked by CORS policy: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'.
I use apollo-server-express and here is my cors option.
const corsOptions = {
origin: "https://studio.apollographql.com",
credentials: true,
}
const app = express()
app.use(cookieParser());
app.use(cors(corsOptions))
I don’t know how to solve this problem. It seems like I have presented my server response as
Access-Control-Allow-Origin: https://studio.apollographql.com
Access-Control-Allow-Credentials: true
to the Studio but why it always giving the errors.
Thank you in advance