From 8ef05ced1577a6ced159194d437fcf9fc64e5f6a Mon Sep 17 00:00:00 2001 From: Zak Burke Date: Fri, 8 Dec 2023 14:22:12 -0500 Subject: [PATCH] STCOR-868 IST/FLST backport cleanup Some of the commits being cherry-picked on this branch relied on other work that wasn't directly related to idle-session timeout or fixed-length-session timeout, and hence weren't picked onto the branch but were, in fact necessary, for this work to function correctly. * Restore the `/oidc-landing` route * Pass the correct arguments to `loadResources()` Refs STCOR-868 --- CHANGELOG.md | 1 - src/App.js | 2 +- src/RootWithIntl.js | 13 +++++++++++++ src/components/Login/Login.js | 3 ++- src/components/Login/index.js | 2 +- src/components/OIDCLanding.js | 5 +---- src/discoverServices.js | 8 -------- src/loginServices.js | 2 +- 8 files changed, 19 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ecadea6e..def64009b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,6 @@ ## [10.1.1](https://github.com/folio-org/stripes-core/tree/v10.1.1) (2024-03-25) [Full Changelog](https://github.com/folio-org/stripes-core/compare/v10.1.0...v10.1.1) -* Utilize the `tenant` procured through the SSO login process. Refs STCOR-769. * Use keycloak URLs in place of users-bl for tenant-switch. Refs US1153537. * Idle-session timeout and "Keep working?" modal. Refs STCOR-776. * Always retrieve `clientId` and `tenant` values from `config.tenantOptions` in stripes.config.js. Retires `okapi.tenant`, `okapi.clientId`, and `config.isSingleTenant`. Refs STCOR-787. diff --git a/src/App.js b/src/App.js index ee2857a9a..226750189 100644 --- a/src/App.js +++ b/src/App.js @@ -25,7 +25,7 @@ export default class StripesCore extends Component { const parsedTenant = storedTenant ? JSON.parse(storedTenant) : undefined; const okapi = (typeof okapiConfig === 'object' && Object.keys(okapiConfig).length > 0) - ? { ...okapiConfig, tenant: parsedTenant?.tenantName || okapiConfig.tenant, clientId: parsedTenant?.clientId || okapiConfig.clientId } : { withoutOkapi: true }; + ? { ...okapiConfig, tenant: parsedTenant?.tenantName || okapiConfig.tenant, clientId: parsedTenant?.clientId } : { withoutOkapi: true }; const initialState = merge({}, { okapi }, props.initialState); diff --git a/src/RootWithIntl.js b/src/RootWithIntl.js index 0a1850e98..941d979ca 100644 --- a/src/RootWithIntl.js +++ b/src/RootWithIntl.js @@ -91,6 +91,12 @@ const RootWithIntl = ({ stripes, token = '', isAuthenticated = false, disableAut key="sso-landing" component={} /> + } + /> } key="sso-landing" /> + } + key="oidc-landing" + /> -
+
@@ -160,6 +160,7 @@ class Login extends Component { validationEnabled={false} hasClearIcon={false} autoComplete="current-password" + required /> diff --git a/src/components/Login/index.js b/src/components/Login/index.js index 44e798405..2a741cdbd 100644 --- a/src/components/Login/index.js +++ b/src/components/Login/index.js @@ -1 +1 @@ -export { default } from './LoginCtrl'; +export { default } from './Login'; diff --git a/src/components/OIDCLanding.js b/src/components/OIDCLanding.js index 9c164979f..d72e0805a 100644 --- a/src/components/OIDCLanding.js +++ b/src/components/OIDCLanding.js @@ -100,11 +100,8 @@ const OIDCLanding = () => {
-

code

- {potp} -

error

- {JSON.stringify(samlError, null, 2)} + {JSON.stringify(samlError.current, null, 2)}
diff --git a/src/discoverServices.js b/src/discoverServices.js index 1a3d5d847..dfb719617 100644 --- a/src/discoverServices.js +++ b/src/discoverServices.js @@ -214,13 +214,6 @@ function fetchModules(store) { }); } -/* - * This function probes Okapi to discover what versions of what - * interfaces are supported by the services that it is proxying - * for. This information can be used to configure the UI at run-time - * (e.g. not attempting to fetch loan information for a - * non-circulating library that doesn't provide the circ interface) - */ export function discoverServices(store) { const promises = []; if (config.tenantOptions) { @@ -236,7 +229,6 @@ export function discoverServices(store) { }); } - export function discoveryReducer(state = {}, action) { switch (action.type) { case 'DISCOVERY_APPLICATIONS': diff --git a/src/loginServices.js b/src/loginServices.js index f50b2a4f9..b55bf3111 100644 --- a/src/loginServices.js +++ b/src/loginServices.js @@ -757,7 +757,7 @@ export function validateUser(okapiUrl, store, tenant, session) { tokenExpiration, })); - return loadResources(okapiUrl, store, sessionTenant, user.id); + return loadResources(store, sessionTenant, user.id); }); } else { store.dispatch(clearCurrentUser());