Skip to content

Commit fab47fe

Browse files
no cors
1 parent 9205d01 commit fab47fe

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

apps/demos/shared/anti-forgery/fetch-override.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ async function fetchAntiForgeryToken() {
99
try {
1010
const response = await fetchOrig('https://js.devexpress.com/Demos/NetCore/api/Common/GetAntiForgeryToken', {
1111
method: 'GET',
12-
credentials: 'include',
12+
// credentials: 'include',
1313
cache: 'no-cache',
1414
});
1515

@@ -67,7 +67,7 @@ ajax.sendRequest = (options) => {
6767
};
6868

6969
options.xhrFields = {
70-
withCredentials: true,
70+
// withCredentials: true,
7171
};
7272

7373
sendRequestOrig(options).then(
@@ -94,7 +94,7 @@ window.fetch = async (url, options = {}) => {
9494
...(options.headers || {}),
9595
};
9696

97-
options.credentials = 'include';
97+
// options.credentials = 'include';
9898

9999
return fetchOrig(url, options);
100100
};

apps/demos/shared/anti-forgery/jquery-override.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function fetchAntiForgeryToken() {
99
orig$.ajax({
1010
url: 'https://js.devexpress.com/Demos/NetCore/api/Common/GetAntiForgeryToken',
1111
method: 'GET',
12-
xhrFields: { withCredentials: true },
12+
// xhrFields: { withCredentials: true },
1313
cache: false,
1414
}).done((data) => {
1515
d.resolve(data);
@@ -56,7 +56,10 @@ async function setAntiForgery() {
5656
}
5757

5858
options.headers = { [tokenData.headerName]: tokenData.token, ...(options.headers || {}) };
59-
options.xhrFields = { withCredentials: true, ...(options.xhrFields || {}) };
59+
options.xhrFields = {
60+
// withCredentials: true,
61+
...(options.xhrFields || {}),
62+
};
6063

6164
return originalAjax.call(this, options);
6265
};
@@ -68,7 +71,7 @@ async function setAntiForgery() {
6871
};
6972

7073
options.xhrFields = {
71-
withCredentials: true,
74+
// withCredentials: true,
7275
...(options.xhrFields || {}),
7376
};
7477

0 commit comments

Comments
 (0)