Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STSMACOM-714 handle access-control via cookies #1397

Merged
merged 9 commits into from
Oct 31, 2023
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
* *BREAKING* bump `react-intl` to `v6.4.4`. Refs STSMACOM-780.
* Add possible to pass `paneTitleRef` from `SearchAndSort` to `Pane` that already support `paneTitleRef`. Refs STSMACOM-779.
* Correctly save empty list when all custom fields are removed. Refs STSMACOM-781.
* *BREAKING* Handle access-control via cookies. Refs STSMACOM-714.

## [8.0.0](https://github.com/folio-org/stripes-smart-components/tree/v8.0.0) (2023-01-30)
[Full Changelog](https://github.com/folio-org/stripes-smart-components/compare/v7.3.0...v8.0.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ const propTypes = {
isReduxForm: PropTypes.bool,
okapi: PropTypes.shape({
tenant: PropTypes.string.isRequired,
token: PropTypes.string.isRequired,
url: PropTypes.string.isRequired,
}).isRequired,
onToggle: PropTypes.func,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ const propTypes = {
intl: PropTypes.object,
okapi: PropTypes.shape({
tenant: PropTypes.string.isRequired,
token: PropTypes.string.isRequired,
url: PropTypes.string.isRequired,
}).isRequired,
permissions: permissionsShape.isRequired,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ const propTypes = {
noCustomFieldsFoundLabel: PropTypes.node,
okapi: PropTypes.shape({
tenant: PropTypes.string.isRequired,
token: PropTypes.string.isRequired,
url: PropTypes.string.isRequired,
}).isRequired,
onToggle: PropTypes.func.isRequired,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ const propTypes = {
entityType: PropTypes.string.isRequired,
okapi: PropTypes.shape({
tenant: PropTypes.string.isRequired,
token: PropTypes.string.isRequired,
url: PropTypes.string.isRequired,
}).isRequired,
permissions: permissionsShape.isRequired,
Expand Down
4 changes: 3 additions & 1 deletion lib/CustomFields/utils/makeRequest.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
export default okapi => moduleId => path => options => {
const headers = {
'x-okapi-token': okapi.token,
'x-okapi-tenant': okapi.tenant,
'content-type': 'application/json',
...(okapi.token && { 'x-okapi-token': okapi.token }),
...options.headers,
};

const okapiModuleId = moduleId ? { 'x-okapi-module-id': moduleId } : {};

return fetch(`${okapi.url}/${path}`, {
credentials: 'include',
mode: 'cors',
...options,
headers: {
...headers,
Expand Down
Loading