Skip to content
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.

jaydata with odata provider: withCredentials has no effect #294

@andriy-f

Description

@andriy-f

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;
            }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions