This repository was archived by the owner on Apr 11, 2023. It is now read-only.
This repository was archived by the owner on Apr 11, 2023. It is now read-only.
Description
Hi, I'm using JayData with OData provider. An I use code generated by jaysvcutil.
I have noticed that option withCredentials is not propagated to underlying XMLHttpRequest when requesting data.
Code:
import { factory } from '../services/JayDataContext'
import { } from 'jaydata/odata'
factory({
oDataServiceHost: BACKEND_URL + "/odata",
withCredentials: true
})
.onReady()
.then(ctx => ctx.SomeEntity.toArray())
.then(...
})
The solution is to add change inside jaydata-odatajs (https://github.com/jaystack/olingo-odata4-js).
file: net-browser.js
change:
if (request.headers) {
for (name in request.headers) {
xhr.setRequestHeader(name, request.headers[name]);
}
}
// Code below was added
if(request.withCredentials) {
xhr.withCredentials = true;
}
Reactions are currently unavailable
Hi, I'm using JayData with OData provider. An I use code generated by jaysvcutil.
I have noticed that option withCredentials is not propagated to underlying XMLHttpRequest when requesting data.
Code:
import { factory } from '../services/JayDataContext' import { } from 'jaydata/odata' factory({ oDataServiceHost: BACKEND_URL + "/odata", withCredentials: true }) .onReady() .then(ctx => ctx.SomeEntity.toArray()) .then(... })The solution is to add change inside jaydata-odatajs (https://github.com/jaystack/olingo-odata4-js).
file: net-browser.js
change:
if (request.headers) { for (name in request.headers) { xhr.setRequestHeader(name, request.headers[name]); } } // Code below was added if(request.withCredentials) { xhr.withCredentials = true; }