I'm demoing the Telerik Kendo React Data Grid-- seems fairly straightforward to me but I am attempting to implement their useOdataDataSource hook to pull in data from my API. But for the life of me I cannot find anything in their docs about how to provide headers to send an auth token with the request.

AI helpers say to do this (which is 99% the same as their example except for the headers part):

const dataSource = useODataDataSource({ defaultSkip: 0, take: 10, transport: { read: { url: baseUrl + '/' + name, headers: { 'Authorization': `Bearer ${token}` }, }, delete: { url: (dataItem) => `${baseUrl}/${name}(${getter('ID')(dataItem)})` } }, schema: { model: { id: 'ID' } } });

This will not work, since headers is not a valid property. I do not see where the headers / bearer token can be passed in with this method.

user101289's user avatar

1

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.