diff --git a/packages/my-joy-images/src/state/apollo-client.js b/packages/my-joy-images/src/state/apollo-client.js index 42fcf13b..8cedd2f1 100644 --- a/packages/my-joy-images/src/state/apollo-client.js +++ b/packages/my-joy-images/src/state/apollo-client.js @@ -26,7 +26,10 @@ export default (opts = {}) => { link: new HttpLink({ uri: URI, credentials: 'same-origin', - fetch + fetch, + headers: { + 'X-CSRF-Token': document.cookie.replace(/(?:(?:^|.*;\s*)crumb\s*=\s*([^;]*).*$)|^.*$/, '$1') + } }), ...opts }); diff --git a/packages/my-joy-instances/src/state/apollo-client.js b/packages/my-joy-instances/src/state/apollo-client.js index 42fcf13b..8cedd2f1 100644 --- a/packages/my-joy-instances/src/state/apollo-client.js +++ b/packages/my-joy-instances/src/state/apollo-client.js @@ -26,7 +26,10 @@ export default (opts = {}) => { link: new HttpLink({ uri: URI, credentials: 'same-origin', - fetch + fetch, + headers: { + 'X-CSRF-Token': document.cookie.replace(/(?:(?:^|.*;\s*)crumb\s*=\s*([^;]*).*$)|^.*$/, '$1') + } }), ...opts });