feat: set x-csrf-token header for requests
This commit is contained in:
parent
4a7956782b
commit
b64dbb289d
@ -26,7 +26,10 @@ export default (opts = {}) => {
|
|||||||
link: new HttpLink({
|
link: new HttpLink({
|
||||||
uri: URI,
|
uri: URI,
|
||||||
credentials: 'same-origin',
|
credentials: 'same-origin',
|
||||||
fetch
|
fetch,
|
||||||
|
headers: {
|
||||||
|
'X-CSRF-Token': document.cookie.replace(/(?:(?:^|.*;\s*)crumb\s*=\s*([^;]*).*$)|^.*$/, '$1')
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
...opts
|
...opts
|
||||||
});
|
});
|
||||||
|
@ -26,7 +26,10 @@ export default (opts = {}) => {
|
|||||||
link: new HttpLink({
|
link: new HttpLink({
|
||||||
uri: URI,
|
uri: URI,
|
||||||
credentials: 'same-origin',
|
credentials: 'same-origin',
|
||||||
fetch
|
fetch,
|
||||||
|
headers: {
|
||||||
|
'X-CSRF-Token': document.cookie.replace(/(?:(?:^|.*;\s*)crumb\s*=\s*([^;]*).*$)|^.*$/, '$1')
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
...opts
|
...opts
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user