Commit 43aa0257 authored by Vitaly Slobodin's avatar Vitaly Slobodin

Send credentials with GraphQL fetch requests

fetch won’t send cookies in older browsers
unless you set the credentials init option.
See https://github.com/whatwg/fetch/pull/585

Closes https://gitlab.com/gitlab-org/gitlab/issues/36864
parent 1c6e59fa
...@@ -26,6 +26,10 @@ export default (resolvers = {}, config = {}) => { ...@@ -26,6 +26,10 @@ export default (resolvers = {}, config = {}) => {
headers: { headers: {
[csrf.headerKey]: csrf.token, [csrf.headerKey]: csrf.token,
}, },
// fetch won’t send cookies in older browsers, unless you set the credentials init option.
// We set to `same-origin` which is default value in modern browsers.
// See https://github.com/whatwg/fetch/pull/585 for more information.
credentials: 'same-origin',
}; };
return new ApolloClient({ return new ApolloClient({
......
---
title: Send credentials with GraphQL fetch requests
merge_request: 26386
author:
type: fixed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment