From 7f9be8cf4fce2dee0d24f95d7346066875f81d5c Mon Sep 17 00:00:00 2001 From: Zak Burke Date: Mon, 23 Oct 2023 08:07:41 -0400 Subject: [PATCH] UIU-2977 x-okapi-token header must always be optional (#2578) The `X-Okapi-Token` header is optional and should only be included when a token value is present on the `stripes.okapi` object. Refs UIU-2977 --- CHANGELOG.md | 5 +++++ .../components/PermissionsModal/PermissionsModal.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e93cc7ba4..80182331e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change history for ui-users +## [10.0.4](https://github.com/folio-org/ui-users/tree/v10.0.4) (2023-11-10) +[Full Changelog](https://github.com/folio-org/ui-users/compare/v10.0.3...v10.0.4) + +* Correctly handle optional `X-Okapi-token` request header. Refs UIU-2977. + ## [10.0.3](https://github.com/folio-org/ui-users/tree/v10.0.3) (2023-10-23) [Full Changelog](https://github.com/folio-org/ui-users/compare/v10.0.1...v10.0.3) diff --git a/src/components/PermissionsAccordion/components/PermissionsModal/PermissionsModal.js b/src/components/PermissionsAccordion/components/PermissionsModal/PermissionsModal.js index 4cdbcced2..d284a69da 100644 --- a/src/components/PermissionsAccordion/components/PermissionsModal/PermissionsModal.js +++ b/src/components/PermissionsAccordion/components/PermissionsModal/PermissionsModal.js @@ -170,7 +170,7 @@ class PermissionsModal extends React.Component { const permissions = await GET({ headers: { [OKAPI_TENANT_HEADER]: tenantId || okapi.tenant, - [OKAPI_TOKEN_HEADER]: okapi.token, + ...(okapi.token && { [OKAPI_TOKEN_HEADER]: okapi.token }), } });