refactor(http-client): set xsrf token on post requests

This commit is contained in:
Sarah Vaupel 2020-01-28 18:10:29 +01:00
parent a23a4735c2
commit fe28762d1c

View File

@ -1,3 +1,5 @@
import Cookies from 'js-cookie';
export class HttpClient {
static ACCEPT = {
@ -20,6 +22,8 @@ export class HttpClient {
post(args) {
args.method = 'POST';
args.headers = args.headers || {};
args.headers['X-XSRF-TOKEN'] = Cookies.get('XSRF-TOKEN');
return this._fetch(args);
}