Closed DellanX closed 11 months ago
Closed, request can be recreated with custom parameters such as credentials:
jsonApiRequestInterceptor: (request: Request) => {
console.log(request.url)
request = new Request(request, {
credentials: 'include',
})
const token = Cookies.get('XSRF-TOKEN');
request.headers.append('X-XSRF-TOKEN', token ?? '');
return request;
},
Description
Adds a configuration setting to enable cross origin cookies (
credentials
set toinclude
on Fetch API calls) This is needed for cross-origin API calls with cookie-based authentication. I didn't add testing, as it'd require configuring CORS on the backend. That being said, I have sideloaded the code into my application and can now execute cross-origin requests successfully. (It's a low-risk feature, as it is a configuration setting passed into the connection class, defaults to the 'same-origin' that was previously hardcoded)Fixes #17
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
None, only validate by sideloading into an application. (Cookies are a great weakness of mine, I don't know how to test them)
Checklist before requesting a review