Closed T-iny closed 1 month ago
Hi, The ElasticsearchAPIConnector
constructs elasticsearch query and the requests do not use cookies by default. If you would like to use cookies, it should be handled in your application.
Thanks for your answer @saarikabhasi . The connector manage the request itself. I have set a Bearer Token in the header in the ElasticsearchAPIConnector. But I can not catch the 401 error, Is there any way to catch the 401 error and refresh token? Or is there any way to get the http response? The code I used is like this.
You could try catching errors in your server side code. We currently have example in our doc on how to integrate with node.js.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Is this issue still important to you? If so, please leave a comment and let us know. As always, thank you for your contributions.
Describe the bug The cookie in the network request is missing. The host is a REST API wrapper. To Reproduce
Bearer ${authState?.accessToken?.accessToken}
, }, }, }, } );Config: const [config] = useState({
alwaysSearchOnInitialLoad: true,
apiConnector: connector,
searchQuery: {}...
Driver: const driver = new SearchDriver(config);
SearchProvider: - <SearchProvider config={{ ...config, apiConnector: new ElasticsearchAPIConnector({ host: process.env.NEXT_PUBLIC_ELASTIC_CONNECTOR_HOST, index, }), }} driver={driver}
Expected behavior The cookie send with request. Screenshots If applicable, add screenshots to help explain your problem.
Which backends and packages are you using: Backend: [custom] Packages: [ElasticsearchAPIConnector]
Please review. Thanks!