Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Improve client a bit

dominik-zeglenedd5300b2aff
diff --git a/saleor/static/dashboard-next/index.tsx b/saleor/static/dashboard-next/index.tsx
index 9df25ff671..f587f43082 100644
--- a/saleor/static/dashboard-next/index.tsx
+++ b/saleor/static/dashboard-next/index.tsx
@@ -9,7 +9,6 @@ import React from "react";
import { ApolloProvider } from "react-apollo";
import { render } from "react-dom";
import { BrowserRouter, Route, Switch } from "react-router-dom";
-import Cookies from "universal-cookie";
import { getAuthToken, removeAuthToken } from "./auth";
import AuthProvider from "./auth/AuthProvider";
@@ -46,8 +45,6 @@ import TaxesSection from "./taxes";
import TranslationsSection from "./translations";
import { PermissionEnum } from "./types/globalTypes";
-const cookies = new Cookies();
-
interface ResponseError extends ErrorResponse {
networkError?: Error & {
statusCode?: number;
@@ -72,11 +69,10 @@ const authLink = setContext((_, context) => {
};
});
+// DON'T TOUCH THIS
+// These are separate clients and do not share configs between themselves
+// so we need to explicitly set them
const linkOptions = {
- credentials: "same-origin",
- headers: {
- "X-CSRFToken": cookies.get("csrftoken")
- },
uri: API_URI
};
const uploadLink = createUploadLink(linkOptions);