@zengenti/contensis-react-base 4.0.0-beta.1 → 4.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/{App-cf7e3103.js → App-b56aca04.js} +139 -93
- package/{esm/App-6e8e803b.js.map → cjs/App-b56aca04.js.map} +1 -1
- package/cjs/{ChangePassword.container-a617190b.js → ChangePassword.container-ae35785e.js} +120 -62
- package/{esm/ChangePassword.container-ae0f9ce4.js.map → cjs/ChangePassword.container-ae35785e.js.map} +1 -1
- package/cjs/{ContensisDeliveryApi-9e32960d.js → ContensisDeliveryApi-4fcf049d.js} +71 -17
- package/{esm/ContensisDeliveryApi-c66b0cc3.js.map → cjs/ContensisDeliveryApi-4fcf049d.js.map} +1 -1
- package/cjs/CookieConstants-000427db.js.map +1 -1
- package/cjs/{RouteLoader-3e284fd6.js → RouteLoader-c06dccd5.js} +182 -63
- package/cjs/RouteLoader-c06dccd5.js.map +1 -0
- package/cjs/{ToJs-149fc5e1.js → ToJs-a8d8f3f0.js} +14 -6
- package/cjs/{ToJs-149fc5e1.js.map → ToJs-a8d8f3f0.js.map} +1 -1
- package/cjs/client.js +20 -14
- package/cjs/client.js.map +1 -1
- package/cjs/contensis-react-base.js +275 -139
- package/cjs/contensis-react-base.js.map +1 -1
- package/cjs/forms.js +717 -228
- package/cjs/forms.js.map +1 -1
- package/cjs/{fromJSLeaveImmer-7c363211.js → fromJSLeaveImmer-e74c673c.js} +4 -1
- package/cjs/{fromJSLeaveImmer-7c363211.js.map → fromJSLeaveImmer-e74c673c.js.map} +1 -1
- package/cjs/{reducers-9afb5f89.js → reducers-73a03ef4.js} +31 -10
- package/cjs/{reducers-9afb5f89.js.map → reducers-73a03ef4.js.map} +1 -1
- package/cjs/redux.js +4 -5
- package/cjs/redux.js.map +1 -1
- package/cjs/routing.js +6 -4
- package/cjs/routing.js.map +1 -1
- package/cjs/{sagas-e04b94c1.js → sagas-570f23ba.js} +286 -187
- package/cjs/{sagas-e04b94c1.js.map → sagas-570f23ba.js.map} +1 -1
- package/cjs/search.js +82 -56
- package/cjs/search.js.map +1 -1
- package/cjs/{selectors-46b689d0.js → selectors-14caa813.js} +6 -1
- package/cjs/selectors-14caa813.js.map +1 -0
- package/cjs/urls-6fcaf4c6.js.map +1 -1
- package/cjs/user.js +9 -4
- package/cjs/user.js.map +1 -1
- package/cjs/util.js +55 -35
- package/cjs/util.js.map +1 -1
- package/cjs/{version-79a027cb.js → version-34d91f68.js} +60 -26
- package/cjs/version-34d91f68.js.map +1 -0
- package/cjs/{version-afd4f77e.js → version-a410c88e.js} +6 -3
- package/cjs/{version-afd4f77e.js.map → version-a410c88e.js.map} +1 -1
- package/esm/{App-6e8e803b.js → App-83107d7e.js} +137 -91
- package/{cjs/App-cf7e3103.js.map → esm/App-83107d7e.js.map} +1 -1
- package/esm/{ChangePassword.container-ae0f9ce4.js → ChangePassword.container-76fd5e9b.js} +120 -62
- package/{cjs/ChangePassword.container-a617190b.js.map → esm/ChangePassword.container-76fd5e9b.js.map} +1 -1
- package/esm/{ContensisDeliveryApi-c66b0cc3.js → ContensisDeliveryApi-fe57a037.js} +71 -17
- package/{cjs/ContensisDeliveryApi-9e32960d.js.map → esm/ContensisDeliveryApi-fe57a037.js.map} +1 -1
- package/esm/CookieConstants-3d3b6531.js.map +1 -1
- package/esm/RouteLoader-29fd689a.js +310 -0
- package/esm/RouteLoader-29fd689a.js.map +1 -0
- package/esm/{ToJs-ae860aad.js → ToJs-df57f31d.js} +14 -6
- package/esm/{ToJs-ae860aad.js.map → ToJs-df57f31d.js.map} +1 -1
- package/esm/client.js +21 -15
- package/esm/client.js.map +1 -1
- package/esm/contensis-react-base.js +270 -136
- package/esm/contensis-react-base.js.map +1 -1
- package/esm/forms.js +717 -228
- package/esm/forms.js.map +1 -1
- package/esm/{fromJSLeaveImmer-e2dacd63.js → fromJSLeaveImmer-0114ffcf.js} +4 -1
- package/esm/{fromJSLeaveImmer-e2dacd63.js.map → fromJSLeaveImmer-0114ffcf.js.map} +1 -1
- package/esm/{reducers-3d5c37d1.js → reducers-aa8cef1e.js} +31 -10
- package/esm/{reducers-3d5c37d1.js.map → reducers-aa8cef1e.js.map} +1 -1
- package/esm/redux.js +7 -8
- package/esm/redux.js.map +1 -1
- package/esm/routing.js +3 -4
- package/esm/routing.js.map +1 -1
- package/esm/{sagas-933a8fc8.js → sagas-07e82e18.js} +239 -139
- package/esm/{sagas-933a8fc8.js.map → sagas-07e82e18.js.map} +1 -1
- package/esm/search.js +83 -57
- package/esm/search.js.map +1 -1
- package/esm/{selectors-01074974.js → selectors-691caf02.js} +6 -1
- package/esm/selectors-691caf02.js.map +1 -0
- package/esm/urls-eac9a747.js.map +1 -1
- package/esm/user.js +11 -6
- package/esm/user.js.map +1 -1
- package/esm/util.js +55 -35
- package/esm/util.js.map +1 -1
- package/esm/{version-346a9787.js → version-3d9911e2.js} +60 -26
- package/esm/version-3d9911e2.js.map +1 -0
- package/esm/{version-0fbd1b82.js → version-9f29becb.js} +6 -3
- package/esm/{version-0fbd1b82.js.map → version-9f29becb.js.map} +1 -1
- package/models/redux/appstate.d.ts +2 -3
- package/models/redux/store/history.d.ts +2 -2
- package/models/routing/components/Redirect.d.ts +5 -0
- package/models/routing/components/StaticRouteLoader.d.ts +6 -0
- package/models/routing/httpContext.d.ts +7 -0
- package/models/routing/index.d.ts +3 -0
- package/models/routing/redux/actions.d.ts +2 -3
- package/models/routing/routes.d.ts +11 -5
- package/models/util/ContensisDeliveryApi.d.ts +0 -1
- package/models/util/mergeStaticRoutes.d.ts +1 -0
- package/package.json +3 -5
- package/cjs/RouteLoader-3e284fd6.js.map +0 -1
- package/cjs/selectors-46b689d0.js.map +0 -1
- package/cjs/version-79a027cb.js.map +0 -1
- package/esm/RouteLoader-e3c5505f.js +0 -196
- package/esm/RouteLoader-e3c5505f.js.map +0 -1
- package/esm/selectors-01074974.js.map +0 -1
- package/esm/version-346a9787.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChangePassword.container-ae0f9ce4.js","sources":["../src/routing/util/find-contenttype-mapping.ts","../src/user/transformations/mapClientCredentials.js","../src/user/util/ContensisManagementApi.js","../src/user/util/OidcUserManager.ts","../src/user/util/LoginHelper.class.js","../src/user/redux/sagas/login.js","../src/user/redux/actions.js","../src/user/hooks/useLogin.js","../src/user/containers/Login.container.js","../src/user/hooks/useRegistration.js","../src/user/containers/Registration.container.js","../src/user/hooks/useForgotPassword.js","../src/user/containers/ForgotPassword.container.js","../src/user/hooks/useChangePassword.js","../src/user/containers/ChangePassword.container.js"],"sourcesContent":["import { ContentTypeMapping } from '../routes';\n\nexport const findContentTypeMapping = (\n ContentTypeMappings: ContentTypeMapping[],\n contentTypeId: string\n) => ContentTypeMappings.find(ct => ct.contentTypeID === contentTypeId);\n","import { mapJson } from '~/util/json-mapper';\n\nconst clientCredentials = {\n bearerToken: 'bearerToken',\n bearerTokenExpiryDate: ({ bearerTokenExpiryDate }) =>\n bearerTokenExpiryDate.toISOString(),\n refreshToken: 'refreshToken',\n refreshTokenExpiryDate: ({ refreshTokenExpiryDate }) =>\n refreshTokenExpiryDate.toISOString(),\n contensisClassicToken: 'contensisClassicToken',\n};\nexport default obj => mapJson(obj, clientCredentials);\n","// import { Client } from 'contensis-management-api';\n\nexport const getManagementApiClient = async ({\n bearerToken,\n bearerTokenExpiryDate,\n refreshToken,\n refreshTokenExpiryDate,\n contensisClassicToken,\n username,\n password,\n}) => {\n const rootUrl = SERVERS.api || SERVERS.cms; /* global SERVERS */\n const projectId = PROJECTS[0].id; /* global PROJECTS */\n\n let config = {};\n if (refreshToken) {\n config = {\n clientType: 'contensis_classic_refresh_token',\n clientDetails: {\n refreshToken,\n },\n };\n } else {\n config = {\n clientType: 'contensis_classic',\n clientDetails: {\n username,\n password,\n },\n };\n }\n\n let { Client } = await import('contensis-management-api');\n\n if (typeof window === 'undefined') {\n const { UniversalClient } = await import('contensis-management-api');\n Client = UniversalClient;\n }\n\n const client = Client.create({\n ...config,\n projectId,\n rootUrl,\n });\n\n if (bearerToken) client.bearerToken = bearerToken;\n if (bearerTokenExpiryDate)\n client.bearerTokenExpiryDate = bearerTokenExpiryDate;\n if (refreshToken) client.refreshToken = refreshToken;\n if (refreshTokenExpiryDate)\n client.refreshTokenExpiryDate = refreshTokenExpiryDate;\n if (contensisClassicToken)\n client.contensisClassicToken = contensisClassicToken;\n\n return client;\n};\n","import { UserManagerSettings } from 'oidc-client';\n\nconst context = (\n typeof window != 'undefined' ? window : global\n) as typeof globalThis & {\n WSFED_LOGIN: string;\n};\n\nconst requireOidc =\n process.env.NODE_ENV === 'development'\n ? WSFED_LOGIN === 'true' /* global WSFED_LOGIN */\n : context.WSFED_LOGIN === 'true';\n\nconst servers = SERVERS; /* global SERVERS */\n\nexport const userManagerConfig =\n typeof window !== 'undefined'\n ? {\n authority: `${servers.cms}/authenticate/`,\n client_id: 'WebsiteAdfsClient',\n redirect_uri: window.location.toString(),\n post_logout_redirect_uri: window.location.toString(),\n response_type: 'id_token',\n scope: 'openid',\n filterProtocolClaims: false,\n }\n : {};\n\nexport const createUserManager = async (config: UserManagerSettings) => {\n if (typeof window !== 'undefined' && requireOidc) {\n try {\n const { UserManager } = await import(\n /* webpackChunkName: \"oidcclient\" */ 'oidc-client'\n );\n return new UserManager(config);\n } catch (e) {\n console.error('Exception in createUserManager: ', e);\n }\n } else return {};\n};\n","/* eslint-disable require-atomic-updates */\nimport { to } from 'await-to-js';\n\nimport { getManagementApiClient } from './ContensisManagementApi';\n\nimport mapClientCredentials from '../transformations/mapClientCredentials';\nimport { createUserManager, userManagerConfig } from './OidcUserManager';\nimport { LOGIN_COOKIE, REFRESH_TOKEN_COOKIE } from './CookieConstants';\n\nconst context = typeof window != 'undefined' ? window : global;\n\nexport class LoginHelper {\n static CMS_URL = SERVERS.cms /* global SERVERS */;\n static WSFED_LOGIN =\n process.env.NODE_ENV === 'development'\n ? WSFED_LOGIN === 'true' /* global WSFED_LOGIN */\n : context.WSFED_LOGIN === 'true';\n static LOGIN_ROUTE = '/account/login';\n static ACCESS_DENIED_ROUTE = '/account/access-denied';\n\n cookies;\n constructor(cookies) {\n this.cookies = cookies;\n }\n\n SetLoginCookies({ contensisClassicToken, refreshToken }) {\n console.info(\n 'SetLoginCookies:',\n LOGIN_COOKIE,\n contensisClassicToken,\n REFRESH_TOKEN_COOKIE,\n refreshToken\n );\n\n if (contensisClassicToken)\n this.cookies.SetCookie(LOGIN_COOKIE, contensisClassicToken);\n\n if (refreshToken)\n this.cookies.SetCookie(REFRESH_TOKEN_COOKIE, refreshToken);\n }\n\n GetCachedCredentials() {\n return {\n bearerToken: null,\n bearerTokenExpiryDate: null,\n refreshToken: this.cookies.GetCookie(REFRESH_TOKEN_COOKIE),\n refreshTokenExpiryDate: null,\n contensisClassicToken: this.cookies.GetCookie(LOGIN_COOKIE),\n };\n }\n\n ClearCachedCredentials() {\n this.cookies.DeleteCookie(LOGIN_COOKIE);\n this.cookies.DeleteCookie(REFRESH_TOKEN_COOKIE);\n\n if (LoginHelper.WSFED_LOGIN && typeof window !== 'undefined') {\n // remove any oidc keys left over in localStorage\n const { localStorage } = window;\n const keys = [];\n for (let i = 0; i < localStorage.length; i++) {\n const key = localStorage.key(i);\n if (typeof key === 'string' && key.startsWith('oidc.'))\n keys.push(localStorage.key(i));\n }\n keys.forEach(key => localStorage.removeItem(key));\n }\n }\n\n async LoginUser({ username, password, clientCredentials }) {\n let credentials = clientCredentials;\n let authenticationState = {\n clientCredentials: null,\n isAuthenticated: false,\n isAuthenticationError: false,\n isError: false,\n };\n let transientClient;\n let user;\n\n if (username && password) {\n // Get a management client with username and password\n transientClient = await getManagementApiClient({\n username,\n password,\n });\n\n // Ensure the client has requested a bearer token\n const [loginError, clientBearerToken] = await to(\n transientClient.ensureBearerToken()\n );\n\n // Problem getting token with username and password\n if (loginError) {\n authenticationState = {\n clientCredentials: null,\n errorMessage: loginError.message || null,\n isAuthenticated: false,\n isAuthenticationError: loginError.name.includes(\n 'ContensisAuthenticationError'\n ),\n isError: true,\n };\n this.ClearCachedCredentials();\n }\n\n // Got a token using username and password\n if (clientBearerToken) {\n // Set credentials so we can continue to GetUserDetails\n credentials = mapClientCredentials(transientClient);\n this.SetLoginCookies(credentials);\n authenticationState = {\n clientCredentials: credentials,\n isAuthenticated: true,\n isAuthenticationError: false,\n isError: false,\n };\n }\n }\n\n // If we have credentials supplied by a successful username and password login\n // or clientCredentials supplied in the options argument we can continue to\n // fetch the user's details\n if (credentials) {\n const client =\n transientClient || (await getManagementApiClient(credentials));\n const [error, userDetails] = await LoginHelper.GetUserDetails(client);\n\n if (error) {\n authenticationState = {\n clientCredentials: null,\n errorMessage: error.message,\n isAuthenticated: false,\n isAuthenticationError: false,\n isError: true,\n };\n this.ClearCachedCredentials();\n } else {\n // Ensure we get latest refreshToken and contensisClassicToken from the latest client\n const latestCredentials = mapClientCredentials(client);\n this.SetLoginCookies(latestCredentials);\n\n user = userDetails;\n authenticationState = {\n clientCredentials: latestCredentials,\n isAuthenticated: true,\n isAuthenticationError: false,\n isError: false,\n };\n }\n }\n\n return { authenticationState, user };\n }\n\n LogoutUser(redirectPath) {\n this.ClearCachedCredentials();\n if (LoginHelper.WSFED_LOGIN) {\n LoginHelper.WsFedLogout(redirectPath);\n } else {\n if (redirectPath) LoginHelper.ClientRedirectToPath(redirectPath);\n else LoginHelper.ClientRedirectToSignInPage();\n }\n }\n\n static withCookies = cookieHelper => new LoginHelper(cookieHelper);\n\n static GetUserDetails = async client => {\n let userError,\n groupsError,\n user = {},\n groupsResult;\n\n [userError, user] = await to(client.security.users.getCurrent());\n if (user && user.id) {\n [groupsError, groupsResult] = await to(\n client.security.users.getUserGroups({\n userId: user.id,\n includeInherited: true,\n pageOptions: { pageSize: 100 },\n })\n );\n // Set groups attribute in user object to be the items\n // array from the getUserGroups result\n if (groupsResult && groupsResult.items) user.groups = groupsResult.items;\n\n //If groups call fails then log the error but allow the user to login still\n // eslint-disable-next-line no-console\n if (groupsError) console.log(groupsError);\n }\n return [userError, user];\n };\n\n static ClientRedirectToHome(location) {\n if (typeof window != 'undefined') {\n let url = '/';\n if (location) {\n const { search, hash } = location;\n url = search ? `${url}${search}` : url;\n url = hash ? `${url}${hash}` : url;\n }\n window.location.href = url;\n }\n }\n\n static async ClientRedirectToSignInPage(redirectPath) {\n if (typeof location === 'undefined') return;\n if (LoginHelper.WSFED_LOGIN) {\n await LoginHelper.WsFedLogout();\n await LoginHelper.WsFedLogin();\n } else {\n // Standard Contensis Login\n let url = LoginHelper.LOGIN_ROUTE;\n if (typeof redirectPath === 'string')\n url = `${url}?redirect_uri=${redirectPath}`;\n if (\n typeof location !== 'undefined' &&\n redirectPath !== LoginHelper.LOGIN_ROUTE\n )\n location.replace(url);\n }\n }\n\n static GetAccessDeniedRoute(originalPath) {\n let url = LoginHelper.ACCESS_DENIED_ROUTE;\n if (originalPath !== url && typeof originalPath === 'string')\n url = `${url}?original_uri=${originalPath}`;\n return url;\n }\n\n static ClientRedirectToAccessDeniedPage(originalPath) {\n if (typeof location !== 'undefined')\n location.href = LoginHelper.GetAccessDeniedRoute(originalPath);\n }\n\n static ClientRedirectToPath(redirectPath) {\n if (typeof redirectPath === 'string') {\n if (typeof location !== 'undefined') window.location.href = redirectPath;\n } else LoginHelper.ClientRedirectToHome();\n }\n\n static async WsFedLogin(redirectUri) {\n const userManager = await createUserManager(userManagerConfig);\n userManager.signinRedirect({\n scope: 'openid',\n response_type: 'id_token',\n redirect_uri: redirectUri || window.location.toString(),\n });\n }\n\n static RemoveSecurityTokenQuery() {\n const params = new URLSearchParams(window.location.search);\n if (params.has('securitytoken') || params.has('securityToken')) {\n params.delete('securitytoken');\n params.delete('securityToken');\n window.location = `${window.location.pathname}${\n params.toString() ? `?${params}` : ''\n }`;\n }\n }\n\n static async WsFedLogout(redirectPath) {\n await fetch(\n `${LoginHelper.CMS_URL}/authenticate/logout?jsonResponseRequired=true`,\n {\n credentials: 'include',\n }\n );\n if (redirectPath) {\n window.location = redirectPath;\n } else {\n // Explicitly check and remove any stale\n // security token that may be in the query string\n LoginHelper.RemoveSecurityTokenQuery();\n }\n }\n\n static async GetCredentialsForSecurityToken(securityToken) {\n const [error, response] = await to(\n fetch(`${LoginHelper.CMS_URL}/REST/Contensis/Security/IsAuthenticated`, {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n securityToken: encodeURIComponent(securityToken),\n }),\n })\n );\n if (error) return [{ message: 'Failed to fetch credentials' }];\n if (response.ok) {\n const [parseError, body] = await to(response.json());\n if (parseError) return [parseError];\n\n const { LogonResult, ApplicationData = [] } = body;\n if (LogonResult !== 0) {\n console.info(`Security token is invalid - LogonResult: ${LogonResult}`);\n return [\n { message: 'Security token is invalid', data: ApplicationData },\n ];\n }\n if (ApplicationData.length > 0) {\n let refreshToken;\n ApplicationData.forEach(item => {\n if (item.Key === 'ContensisSecurityRefreshToken')\n refreshToken = item.Value;\n });\n if (!refreshToken) {\n return [\n {\n message:\n 'Fetch credentials: Unable to find ContensisSecurityRefreshToken',\n },\n ];\n }\n return [undefined, refreshToken];\n } else {\n return [\n {\n message:\n 'Fetch credentials: Unable to find ContensisSecurityRefreshToken',\n },\n ];\n }\n } else {\n return [\n {\n message: `Fetch credentials error: ${response.status} ${response.statusText}`,\n },\n ];\n }\n }\n\n // static isZengentiStaff(email) {\n // const emailRefs = ['@zengenti', '@contensis'];\n\n // return emailRefs.some(emailRef => {\n // if (email.includes(emailRef)) {\n // return true;\n // }\n // });\n // }\n}\n","import { takeEvery, select, put, call } from 'redux-saga/effects';\nimport {\n SET_AUTHENTICATION_STATE,\n LOGIN_USER,\n LOGOUT_USER,\n VALIDATE_USER,\n} from '../types';\nimport {\n selectUserIsAuthenticated,\n selectClientCredentials,\n selectUserGroups,\n} from '../selectors';\n\nimport { setRoute } from '~/routing/redux/actions';\nimport { selectCurrentSearch } from '~/routing/redux/selectors';\nimport { findContentTypeMapping } from '~/routing/util/find-contenttype-mapping';\n\nimport mapClientCredentials from '~/user/transformations/mapClientCredentials';\n\nimport { getManagementApiClient } from '~/user/util/ContensisManagementApi';\nimport { LoginHelper } from '~/user/util/LoginHelper.class';\nimport { matchUserGroup } from '~/user/util/matchGroups';\nimport { queryParams } from '~/util/navigation';\n\nexport const loginSagas = [\n takeEvery(LOGIN_USER, loginUserSaga),\n takeEvery(LOGOUT_USER, logoutUserSaga),\n takeEvery(VALIDATE_USER, validateUserSaga),\n takeEvery(SET_AUTHENTICATION_STATE, redirectAfterSuccessfulLoginSaga),\n];\n\nexport function* handleRequiresLoginSaga(action) {\n const {\n cookies,\n entry,\n path,\n requireLogin,\n routes: { ContentTypeMappings },\n staticRoute,\n } = action;\n let userLoggedIn = yield select(selectUserIsAuthenticated);\n\n // Check for a securityToken in querystring\n const currentQs = queryParams(yield select(selectCurrentSearch));\n const securityToken = currentQs.securityToken || currentQs.securitytoken;\n\n // Check if any of the defined routes have \"requireLogin\" attribute\n const { requireLogin: authRoute } = (staticRoute && staticRoute.route) || {};\n const { requireLogin: authContentType } =\n (entry &&\n findContentTypeMapping(ContentTypeMappings, entry?.sys?.contentTypeId)) ||\n {};\n\n // If requireLogin, authRoute or authContentType has been specified as an\n // array of groups we can merge all the arrays and match on any group supplied\n const routeRequiresGroups = [\n ...((Array.isArray(authContentType) && authContentType) || []),\n ...((Array.isArray(authRoute) && authRoute) || []),\n ...((Array.isArray(requireLogin) && requireLogin) || []),\n ];\n const routeRequiresLogin = !!authContentType || !!authRoute || !!requireLogin;\n\n if (!userLoggedIn) {\n // If cookies or securityToken are found on any route change\n // always validate and login the user\n if (routeRequiresLogin) {\n console.info(`Route requires login: ${path}`);\n // If routeRequiresLogin do a blocking call that returns userLoggedIn\n userLoggedIn = yield call(validateUserSaga, {\n cookies,\n securityToken,\n });\n console.info(`User logged in: ${userLoggedIn}`);\n }\n // otherwise do a non blocking put to handle validation in the background\n else yield put({ type: VALIDATE_USER, cookies, securityToken });\n }\n\n if (routeRequiresLogin) {\n // If a security token is in the querystring and we are not already\n // logged in something is wrong and we won't bother going on another redirect loop\n if (!userLoggedIn && !securityToken) {\n LoginHelper.ClientRedirectToSignInPage(action.location.pathname);\n } else if (routeRequiresGroups.length > 0) {\n const userGroups = yield select(selectUserGroups, 'js');\n const groupMatch = matchUserGroup(userGroups, routeRequiresGroups);\n\n if (!groupMatch)\n LoginHelper.ClientRedirectToAccessDeniedPage(action.location.pathname);\n }\n }\n\n return userLoggedIn;\n}\n\nfunction* validateUserSaga({ cookies, securityToken }) {\n const login = LoginHelper.withCookies(cookies);\n // Check for refreshToken in cookies\n let clientCredentials = login.GetCachedCredentials();\n\n if (\n securityToken ||\n clientCredentials.securityToken ||\n clientCredentials.refreshToken\n ) {\n // We only attempt to validate the user if one of the stored\n // tokens are found, in this case we set loading state manually\n // so we don't need to set and unset loading if there are no stored\n yield put({\n type: SET_AUTHENTICATION_STATE,\n authenticationState: {\n isLoading: true,\n },\n });\n // If we have just a security token we will call a CMS endpoint\n // and provide us with a RefreshToken cookie we can use during login\n if (\n securityToken ||\n (clientCredentials.securityToken && !clientCredentials.refreshToken)\n ) {\n const [error, refreshToken] =\n yield LoginHelper.GetCredentialsForSecurityToken(\n securityToken || clientCredentials.securityToken\n );\n if (refreshToken) {\n // Set cookies and reload values\n login.SetLoginCookies({\n contensisClassicToken: securityToken,\n refreshToken,\n });\n clientCredentials = login.GetCachedCredentials();\n }\n if (error) {\n login.ClearCachedCredentials();\n yield put({\n type: SET_AUTHENTICATION_STATE,\n authenticationState: {\n isError: true,\n errorMessage:\n error?.message ||\n (error && 'toString' in error && error.toString()),\n },\n });\n }\n }\n\n // Log the user in if a refreshToken is found\n if (clientCredentials.refreshToken) {\n console.info(\n `Login user with refreshToken ${clientCredentials.refreshToken}`\n );\n yield call(loginUserSaga, {\n clientCredentials,\n cookies: login.cookies,\n });\n }\n }\n\n // Tell any callers have we successfully logged in?\n return yield select(selectUserIsAuthenticated);\n}\n\nfunction* loginUserSaga(action = {}) {\n const { username, password, clientCredentials, cookies } = action;\n const login = LoginHelper.withCookies(cookies);\n\n // If a WSFED_LOGIN site has dispatched the loginUser action\n // just redirect them to the Identity Provider sign in\n if (action.type === LOGIN_USER && LoginHelper.WSFED_LOGIN)\n LoginHelper.ClientRedirectToSignInPage();\n\n const { authenticationState, user } = yield login.LoginUser({\n username,\n password,\n clientCredentials,\n });\n\n yield put({\n type: SET_AUTHENTICATION_STATE,\n authenticationState,\n user,\n });\n}\n\nconst removeHostnamePart = path => {\n // eslint-disable-next-line no-console\n console.log(path);\n const relativePath = '/' + path.split('/').splice(3).join('/');\n // eslint-disable-next-line no-console\n console.log(relativePath);\n return relativePath;\n};\n\nfunction* redirectAfterSuccessfulLoginSaga() {\n const isLoggedIn = yield select(selectUserIsAuthenticated);\n const { redirect_uri: redirectPath, ReturnURL: assetRedirectPath } =\n queryParams(yield select(selectCurrentSearch));\n\n if (isLoggedIn && assetRedirectPath && typeof window != 'undefined') {\n const path = removeHostnamePart(assetRedirectPath);\n // This has to be a hard href to get the app to\n // leave React and hit the server for the IIS hosted assets\n window.location.href = path;\n // yield put(setRoute(path)); // does not work in this scenario\n } else if (isLoggedIn && redirectPath) {\n yield put(setRoute(redirectPath));\n }\n}\n\nfunction* logoutUserSaga({ redirectPath, cookies }) {\n yield put({\n type: SET_AUTHENTICATION_STATE,\n user: null,\n });\n yield LoginHelper.withCookies(cookies).LogoutUser(redirectPath);\n}\n\nexport function* refreshSecurityToken() {\n const clientCredentials = yield select(selectClientCredentials, 'js');\n if (Object.keys(clientCredentials).length > 0) {\n const client = yield getManagementApiClient(clientCredentials);\n yield client.authenticate();\n\n yield put({\n type: SET_AUTHENTICATION_STATE,\n authenticationState: {\n clientCredentials: mapClientCredentials(client),\n },\n });\n }\n}\n","import { action } from '~/redux/util';\nimport {\n CHANGE_USER_PASSWORD,\n LOGIN_USER,\n LOGOUT_USER,\n REGISTER_USER,\n REQUEST_USER_PASSWORD_RESET,\n RESET_USER_PASSWORD,\n} from './types';\n\nexport const loginUser = (username, password, cookies) =>\n action(LOGIN_USER, { username, password, cookies });\n\nexport const logoutUser = (redirectPath, cookies) =>\n action(LOGOUT_USER, { redirectPath, cookies });\n\nexport const registerUser = (user, mappers) =>\n action(REGISTER_USER, {\n user,\n mappers,\n });\n\nexport const requestPasswordReset = userEmailObject =>\n action(REQUEST_USER_PASSWORD_RESET, { userEmailObject });\n\nexport const resetPassword = resetPasswordObject =>\n action(RESET_USER_PASSWORD, { resetPasswordObject });\n\nexport const changePassword = (userId, currentPassword, newPassword) =>\n action(CHANGE_USER_PASSWORD, { userId, currentPassword, newPassword });\n","import { useCookies } from 'react-cookie';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { loginUser, logoutUser } from '../redux/actions';\nimport {\n selectUser,\n selectUserIsAuthenticationError,\n selectUserIsError,\n selectUserErrorMessage,\n selectUserIsAuthenticated,\n selectUserIsLoading,\n} from '../redux/selectors';\nimport { CookieHelper } from '../util/CookieHelper.class';\n\nconst useLogin = () => {\n const cookies = new CookieHelper(...useCookies());\n\n const dispatch = useDispatch();\n const select = useSelector;\n\n return {\n loginUser: (username, password) =>\n dispatch(loginUser(username, password, cookies)),\n logoutUser: redirectPath => dispatch(logoutUser(redirectPath, cookies)),\n errorMessage: select(selectUserErrorMessage),\n isAuthenticated: select(selectUserIsAuthenticated),\n isAuthenticationError: select(selectUserIsAuthenticationError),\n isError: select(selectUserIsError),\n isLoading: select(selectUserIsLoading),\n user: select(selectUser),\n // DEPRECATED: authenticationError is deprecated use isAuthenticationError instead\n authenticationError: select(selectUserIsAuthenticationError),\n // DEPRECATED: authenticationErrorMessage is deprecated use errorMessage instead\n authenticationErrorMessage: select(selectUserErrorMessage),\n // DEPRECATED: error is deprecated use isError instead\n error: select(selectUserIsError),\n };\n};\n\nexport default useLogin;\n","import useLogin from '../hooks/useLogin';\nimport { toJS } from '~/util/ToJs';\n\nconst LoginContainer = ({ children, ...props }) => {\n const userProps = useLogin(props);\n return children(userProps);\n};\n\nLoginContainer.propTypes = {};\n\nexport default toJS(LoginContainer);\n","import { useDispatch, useSelector } from 'react-redux';\nimport { registerUser } from '../redux/actions';\nimport {\n selectUserRegistration,\n selectUserRegistrationError,\n selectUserRegistrationIsLoading,\n selectUserRegistrationIsSuccess,\n} from '../redux/selectors';\n\nconst useRegistration = () => {\n const dispatch = useDispatch();\n const select = useSelector;\n\n return {\n registerUser: (user, mappers) => dispatch(registerUser(user, mappers)),\n error: select(selectUserRegistrationError),\n isLoading: select(selectUserRegistrationIsLoading),\n isSuccess: select(selectUserRegistrationIsSuccess),\n user: select(selectUserRegistration),\n };\n};\n\nexport default useRegistration;\n","import useRegistration from '../hooks/useRegistration';\nimport { toJS } from '~/util/ToJs';\n\nconst RegistrationContainer = ({ children, ...props }) => {\n const userProps = useRegistration(props);\n return children(userProps);\n};\n\nRegistrationContainer.propTypes = {};\n\nexport default toJS(RegistrationContainer);\n","import { useDispatch, useSelector } from 'react-redux';\nimport { requestPasswordReset, resetPassword } from '../redux/actions';\nimport {\n selectPasswordResetRequestError,\n selectPasswordResetRequestSending,\n selectPasswordResetRequestSent,\n selectResetPasswordSending,\n selectResetPasswordSent,\n selectResetPasswordError,\n} from '../redux/selectors';\nimport { selectCurrentSearch } from '~/routing/redux/selectors';\n\nconst useForgotPassword = () => {\n const dispatch = useDispatch();\n const select = useSelector;\n\n return {\n isLoading: select(selectPasswordResetRequestSending),\n isSuccess: select(selectPasswordResetRequestSent),\n error: select(selectPasswordResetRequestError),\n requestPasswordReset: userEmailObject =>\n dispatch(requestPasswordReset(userEmailObject)),\n\n setNewPassword: {\n queryString: select(selectCurrentSearch),\n isLoading: select(selectResetPasswordSending),\n isSuccess: select(selectResetPasswordSent),\n error: select(selectResetPasswordError),\n submit: resetPasswordObject =>\n dispatch(resetPassword(resetPasswordObject)),\n },\n };\n};\n\nexport default useForgotPassword;\n","import useForgotPassword from '../hooks/useForgotPassword';\nimport { toJS } from '~/util/ToJs';\n\nconst ForgotPasswordContainer = ({ children, ...props }) => {\n const userProps = useForgotPassword(props);\n return children(userProps);\n};\n\nForgotPasswordContainer.propTypes = {};\n\nexport default toJS(ForgotPasswordContainer);\n","import { useDispatch, useSelector } from 'react-redux';\nimport { changePassword } from '../redux/actions';\nimport {\n selectChangePasswordSending,\n selectChangePasswordSent,\n selectChangePasswordError,\n selectUserIsAuthenticated,\n selectUserGuid,\n} from '../redux/selectors';\n\nconst useChangePassword = () => {\n const dispatch = useDispatch();\n const select = useSelector;\n\n return {\n isLoading: select(selectChangePasswordSending),\n isSuccess: select(selectChangePasswordSent),\n userId: select(selectUserGuid),\n isLoggedIn: select(selectUserIsAuthenticated),\n error: select(selectChangePasswordError),\n changePassword: (userId, currentPassword, newPassword) =>\n dispatch(changePassword(userId, currentPassword, newPassword)),\n };\n};\n\nexport default useChangePassword;\n","import useChangePassword from '../hooks/useChangePassword';\nimport { toJS } from '~/util/ToJs';\n\nconst ChangePasswordContainer = ({ children, ...props }) => {\n const userProps = useChangePassword(props);\n return children(userProps);\n};\n\nChangePasswordContainer.propTypes = {};\n\nexport default toJS(ChangePasswordContainer);\n"],"names":["findContentTypeMapping","ContentTypeMappings","contentTypeId","find","ct","contentTypeID","clientCredentials","bearerToken","bearerTokenExpiryDate","toISOString","refreshToken","refreshTokenExpiryDate","contensisClassicToken","obj","mapJson","getManagementApiClient","username","password","rootUrl","SERVERS","api","cms","projectId","PROJECTS","id","config","clientType","clientDetails","Client","window","UniversalClient","client","create","context","global","requireOidc","process","env","NODE_ENV","WSFED_LOGIN","servers","userManagerConfig","authority","client_id","redirect_uri","location","toString","post_logout_redirect_uri","response_type","scope","filterProtocolClaims","createUserManager","UserManager","e","console","error","LoginHelper","constructor","cookies","SetLoginCookies","info","LOGIN_COOKIE","REFRESH_TOKEN_COOKIE","SetCookie","GetCachedCredentials","GetCookie","ClearCachedCredentials","DeleteCookie","localStorage","keys","i","length","key","startsWith","push","forEach","removeItem","LoginUser","credentials","authenticationState","isAuthenticated","isAuthenticationError","isError","transientClient","user","loginError","clientBearerToken","to","ensureBearerToken","errorMessage","message","name","includes","mapClientCredentials","userDetails","GetUserDetails","latestCredentials","LogoutUser","redirectPath","WsFedLogout","ClientRedirectToPath","ClientRedirectToSignInPage","ClientRedirectToHome","url","search","hash","href","WsFedLogin","LOGIN_ROUTE","replace","GetAccessDeniedRoute","originalPath","ACCESS_DENIED_ROUTE","ClientRedirectToAccessDeniedPage","redirectUri","userManager","signinRedirect","RemoveSecurityTokenQuery","params","URLSearchParams","has","delete","pathname","fetch","CMS_URL","GetCredentialsForSecurityToken","securityToken","response","method","headers","Accept","body","JSON","stringify","encodeURIComponent","ok","parseError","json","LogonResult","ApplicationData","data","item","Key","Value","undefined","status","statusText","withCookies","cookieHelper","userError","groupsError","groupsResult","security","users","getCurrent","getUserGroups","userId","includeInherited","pageOptions","pageSize","items","groups","log","loginSagas","takeEvery","LOGIN_USER","loginUserSaga","LOGOUT_USER","logoutUserSaga","VALIDATE_USER","validateUserSaga","SET_AUTHENTICATION_STATE","redirectAfterSuccessfulLoginSaga","handleRequiresLoginSaga","action","_entry$sys","entry","path","requireLogin","routes","staticRoute","userLoggedIn","select","selectUserIsAuthenticated","currentQs","queryParams","selectCurrentSearch","securitytoken","authRoute","route","authContentType","sys","routeRequiresGroups","Array","isArray","routeRequiresLogin","call","put","type","userGroups","selectUserGroups","groupMatch","matchUserGroup","login","isLoading","removeHostnamePart","relativePath","split","splice","join","isLoggedIn","ReturnURL","assetRedirectPath","setRoute","refreshSecurityToken","selectClientCredentials","Object","authenticate","loginUser","logoutUser","registerUser","mappers","REGISTER_USER","requestPasswordReset","userEmailObject","REQUEST_USER_PASSWORD_RESET","resetPassword","resetPasswordObject","RESET_USER_PASSWORD","changePassword","currentPassword","newPassword","CHANGE_USER_PASSWORD","useLogin","CookieHelper","useCookies","dispatch","useDispatch","useSelector","selectUserErrorMessage","selectUserIsAuthenticationError","selectUserIsError","selectUserIsLoading","selectUser","authenticationError","authenticationErrorMessage","LoginContainer","children","props","userProps","propTypes","toJS","useRegistration","selectUserRegistrationError","selectUserRegistrationIsLoading","isSuccess","selectUserRegistrationIsSuccess","selectUserRegistration","RegistrationContainer","useForgotPassword","selectPasswordResetRequestSending","selectPasswordResetRequestSent","selectPasswordResetRequestError","setNewPassword","queryString","selectResetPasswordSending","selectResetPasswordSent","selectResetPasswordError","submit","ForgotPasswordContainer","useChangePassword","selectChangePasswordSending","selectChangePasswordSent","selectUserGuid","selectChangePasswordError","ChangePasswordContainer"],"mappings":";;;;;;;;;;MAEaA,sBAAsB,GAAGA,CACpCC,mBAAyC,EACzCC,aAAqB,KAClBD,mBAAmB,CAACE,IAAI,CAACC,EAAE,IAAIA,EAAE,CAACC,aAAa,KAAKH,aAAa;;ACHtE,MAAMI,iBAAiB,GAAG;AACxBC,EAAAA,WAAW,EAAE,aAAa;AAC1BC,EAAAA,qBAAqB,EAAEA,CAAC;AAAEA,IAAAA,qBAAAA;AAAsB,GAAC,KAC/CA,qBAAqB,CAACC,WAAW,EAAE;AACrCC,EAAAA,YAAY,EAAE,cAAc;AAC5BC,EAAAA,sBAAsB,EAAEA,CAAC;AAAEA,IAAAA,sBAAAA;AAAuB,GAAC,KACjDA,sBAAsB,CAACF,WAAW,EAAE;AACtCG,EAAAA,qBAAqB,EAAE,uBAAA;AACzB,CAAC,CAAA;AACD,2BAAA,CAAeC,GAAG,IAAIC,OAAO,CAACD,GAAG,EAAEP,iBAAiB,CAAC;;ACXrD;;AAEaS,MAAAA,sBAAsB,GAAG,OAAO;EAC3CR,WAAW;EACXC,qBAAqB;EACrBE,YAAY;EACZC,sBAAsB;EACtBC,qBAAqB;EACrBI,QAAQ;AACRC,EAAAA,QAAAA;AACF,CAAC,KAAK;EACJ,MAAMC,OAAO,GAAGC,OAAO,CAACC,GAAG,IAAID,OAAO,CAACE,GAAG,CAAC;EAC3C,MAAMC,SAAS,GAAGC,QAAQ,CAAC,CAAC,CAAC,CAACC,EAAE,CAAC;;EAEjC,IAAIC,MAAM,GAAG,EAAE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SAAS,EAAEzE,MAAM,CAAC0F,wBAAwB,CAAC;AAC3CpH,IAAAA,MAAM,EAAE0B,MAAM,CAAC2F,cAAc,CAAC;AAC9B/D,IAAAA,UAAU,EAAE5B,MAAM,CAACC,yBAAyB,CAAC;AAC7ChI,IAAAA,KAAK,EAAE+H,MAAM,CAAC4F,yBAAyB,CAAC;AACxC7C,IAAAA,cAAc,EAAEA,CAACzE,MAAM,EAAE0E,eAAe,EAAEC,WAAW,KACnDK,QAAQ,CAACP,cAAc,CAACzE,MAAM,EAAE0E,eAAe,EAAEC,WAAW,CAAC,CAAA;GAChE,CAAA;AACH;;ACpBA,MAAM4C,uBAAuB,GAAGA,CAAC;EAAE5B,QAAQ;EAAE,GAAGC,KAAAA;AAAM,CAAC,KAAK;AAC1D,EAAA,MAAMC,SAAS,GAAGqB,iBAAiB,CAAM,CAAC,CAAA;EAC1C,OAAOvB,QAAQ,CAACE,SAAS,CAAC,CAAA;AAC5B,CAAC,CAAA;AAED0B,uBAAuB,CAACzB,SAAS,GAAG,EAAE,CAAA;AAEtC,+BAAeC,IAAI,CAACwB,uBAAuB,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"ChangePassword.container-ae35785e.js","sources":["../src/routing/util/find-contenttype-mapping.ts","../src/user/transformations/mapClientCredentials.js","../src/user/util/ContensisManagementApi.js","../src/user/util/OidcUserManager.ts","../src/user/util/LoginHelper.class.js","../src/user/redux/sagas/login.js","../src/user/redux/actions.js","../src/user/hooks/useLogin.js","../src/user/containers/Login.container.js","../src/user/hooks/useRegistration.js","../src/user/containers/Registration.container.js","../src/user/hooks/useForgotPassword.js","../src/user/containers/ForgotPassword.container.js","../src/user/hooks/useChangePassword.js","../src/user/containers/ChangePassword.container.js"],"sourcesContent":["import { ContentTypeMapping } from '../routes';\n\nexport const findContentTypeMapping = (\n ContentTypeMappings: ContentTypeMapping[],\n contentTypeId: string\n) => ContentTypeMappings.find(ct => ct.contentTypeID === contentTypeId);\n","import { mapJson } from '~/util/json-mapper';\n\nconst clientCredentials = {\n bearerToken: 'bearerToken',\n bearerTokenExpiryDate: ({ bearerTokenExpiryDate }) =>\n bearerTokenExpiryDate.toISOString(),\n refreshToken: 'refreshToken',\n refreshTokenExpiryDate: ({ refreshTokenExpiryDate }) =>\n refreshTokenExpiryDate.toISOString(),\n contensisClassicToken: 'contensisClassicToken',\n};\nexport default obj => mapJson(obj, clientCredentials);\n","// import { Client } from 'contensis-management-api';\n\nexport const getManagementApiClient = async ({\n bearerToken,\n bearerTokenExpiryDate,\n refreshToken,\n refreshTokenExpiryDate,\n contensisClassicToken,\n username,\n password,\n}) => {\n const rootUrl = SERVERS.api || SERVERS.cms; /* global SERVERS */\n const projectId = PROJECTS[0].id; /* global PROJECTS */\n\n let config = {};\n if (refreshToken) {\n config = {\n clientType: 'contensis_classic_refresh_token',\n clientDetails: {\n refreshToken,\n },\n };\n } else {\n config = {\n clientType: 'contensis_classic',\n clientDetails: {\n username,\n password,\n },\n };\n }\n\n let { Client } = await import('contensis-management-api');\n\n if (typeof window === 'undefined') {\n const { UniversalClient } = await import('contensis-management-api');\n Client = UniversalClient;\n }\n\n const client = Client.create({\n ...config,\n projectId,\n rootUrl,\n });\n\n if (bearerToken) client.bearerToken = bearerToken;\n if (bearerTokenExpiryDate)\n client.bearerTokenExpiryDate = bearerTokenExpiryDate;\n if (refreshToken) client.refreshToken = refreshToken;\n if (refreshTokenExpiryDate)\n client.refreshTokenExpiryDate = refreshTokenExpiryDate;\n if (contensisClassicToken)\n client.contensisClassicToken = contensisClassicToken;\n\n return client;\n};\n","import { UserManagerSettings } from 'oidc-client';\n\nconst context = (\n typeof window != 'undefined' ? window : global\n) as typeof globalThis & {\n WSFED_LOGIN: string;\n};\n\nconst requireOidc =\n process.env.NODE_ENV === 'development'\n ? WSFED_LOGIN === 'true' /* global WSFED_LOGIN */\n : context.WSFED_LOGIN === 'true';\n\nconst servers = SERVERS; /* global SERVERS */\n\nexport const userManagerConfig =\n typeof window !== 'undefined'\n ? {\n authority: `${servers.cms}/authenticate/`,\n client_id: 'WebsiteAdfsClient',\n redirect_uri: window.location.toString(),\n post_logout_redirect_uri: window.location.toString(),\n response_type: 'id_token',\n scope: 'openid',\n filterProtocolClaims: false,\n }\n : {};\n\nexport const createUserManager = async (config: UserManagerSettings) => {\n if (typeof window !== 'undefined' && requireOidc) {\n try {\n const { UserManager } = await import(\n /* webpackChunkName: \"oidcclient\" */ 'oidc-client'\n );\n return new UserManager(config);\n } catch (e) {\n console.error('Exception in createUserManager: ', e);\n }\n } else return {};\n};\n","/* eslint-disable require-atomic-updates */\nimport { to } from 'await-to-js';\n\nimport { getManagementApiClient } from './ContensisManagementApi';\n\nimport mapClientCredentials from '../transformations/mapClientCredentials';\nimport { createUserManager, userManagerConfig } from './OidcUserManager';\nimport { LOGIN_COOKIE, REFRESH_TOKEN_COOKIE } from './CookieConstants';\n\nconst context = typeof window != 'undefined' ? window : global;\n\nexport class LoginHelper {\n static CMS_URL = SERVERS.cms /* global SERVERS */;\n static WSFED_LOGIN =\n process.env.NODE_ENV === 'development'\n ? WSFED_LOGIN === 'true' /* global WSFED_LOGIN */\n : context.WSFED_LOGIN === 'true';\n static LOGIN_ROUTE = '/account/login';\n static ACCESS_DENIED_ROUTE = '/account/access-denied';\n\n cookies;\n constructor(cookies) {\n this.cookies = cookies;\n }\n\n SetLoginCookies({ contensisClassicToken, refreshToken }) {\n console.info(\n 'SetLoginCookies:',\n LOGIN_COOKIE,\n contensisClassicToken,\n REFRESH_TOKEN_COOKIE,\n refreshToken\n );\n\n if (contensisClassicToken)\n this.cookies.SetCookie(LOGIN_COOKIE, contensisClassicToken);\n\n if (refreshToken)\n this.cookies.SetCookie(REFRESH_TOKEN_COOKIE, refreshToken);\n }\n\n GetCachedCredentials() {\n return {\n bearerToken: null,\n bearerTokenExpiryDate: null,\n refreshToken: this.cookies.GetCookie(REFRESH_TOKEN_COOKIE),\n refreshTokenExpiryDate: null,\n contensisClassicToken: this.cookies.GetCookie(LOGIN_COOKIE),\n };\n }\n\n ClearCachedCredentials() {\n this.cookies.DeleteCookie(LOGIN_COOKIE);\n this.cookies.DeleteCookie(REFRESH_TOKEN_COOKIE);\n\n if (LoginHelper.WSFED_LOGIN && typeof window !== 'undefined') {\n // remove any oidc keys left over in localStorage\n const { localStorage } = window;\n const keys = [];\n for (let i = 0; i < localStorage.length; i++) {\n const key = localStorage.key(i);\n if (typeof key === 'string' && key.startsWith('oidc.'))\n keys.push(localStorage.key(i));\n }\n keys.forEach(key => localStorage.removeItem(key));\n }\n }\n\n async LoginUser({ username, password, clientCredentials }) {\n let credentials = clientCredentials;\n let authenticationState = {\n clientCredentials: null,\n isAuthenticated: false,\n isAuthenticationError: false,\n isError: false,\n };\n let transientClient;\n let user;\n\n if (username && password) {\n // Get a management client with username and password\n transientClient = await getManagementApiClient({\n username,\n password,\n });\n\n // Ensure the client has requested a bearer token\n const [loginError, clientBearerToken] = await to(\n transientClient.ensureBearerToken()\n );\n\n // Problem getting token with username and password\n if (loginError) {\n authenticationState = {\n clientCredentials: null,\n errorMessage: loginError.message || null,\n isAuthenticated: false,\n isAuthenticationError: loginError.name.includes(\n 'ContensisAuthenticationError'\n ),\n isError: true,\n };\n this.ClearCachedCredentials();\n }\n\n // Got a token using username and password\n if (clientBearerToken) {\n // Set credentials so we can continue to GetUserDetails\n credentials = mapClientCredentials(transientClient);\n this.SetLoginCookies(credentials);\n authenticationState = {\n clientCredentials: credentials,\n isAuthenticated: true,\n isAuthenticationError: false,\n isError: false,\n };\n }\n }\n\n // If we have credentials supplied by a successful username and password login\n // or clientCredentials supplied in the options argument we can continue to\n // fetch the user's details\n if (credentials) {\n const client =\n transientClient || (await getManagementApiClient(credentials));\n const [error, userDetails] = await LoginHelper.GetUserDetails(client);\n\n if (error) {\n authenticationState = {\n clientCredentials: null,\n errorMessage: error.message,\n isAuthenticated: false,\n isAuthenticationError: false,\n isError: true,\n };\n this.ClearCachedCredentials();\n } else {\n // Ensure we get latest refreshToken and contensisClassicToken from the latest client\n const latestCredentials = mapClientCredentials(client);\n this.SetLoginCookies(latestCredentials);\n\n user = userDetails;\n authenticationState = {\n clientCredentials: latestCredentials,\n isAuthenticated: true,\n isAuthenticationError: false,\n isError: false,\n };\n }\n }\n\n return { authenticationState, user };\n }\n\n LogoutUser(redirectPath) {\n this.ClearCachedCredentials();\n if (LoginHelper.WSFED_LOGIN) {\n LoginHelper.WsFedLogout(redirectPath);\n } else {\n if (redirectPath) LoginHelper.ClientRedirectToPath(redirectPath);\n else LoginHelper.ClientRedirectToSignInPage();\n }\n }\n\n static withCookies = cookieHelper => new LoginHelper(cookieHelper);\n\n static GetUserDetails = async client => {\n let userError,\n groupsError,\n user = {},\n groupsResult;\n\n [userError, user] = await to(client.security.users.getCurrent());\n if (user && user.id) {\n [groupsError, groupsResult] = await to(\n client.security.users.getUserGroups({\n userId: user.id,\n includeInherited: true,\n pageOptions: { pageSize: 100 },\n })\n );\n // Set groups attribute in user object to be the items\n // array from the getUserGroups result\n if (groupsResult && groupsResult.items) user.groups = groupsResult.items;\n\n //If groups call fails then log the error but allow the user to login still\n // eslint-disable-next-line no-console\n if (groupsError) console.log(groupsError);\n }\n return [userError, user];\n };\n\n static ClientRedirectToHome(location) {\n if (typeof window != 'undefined') {\n let url = '/';\n if (location) {\n const { search, hash } = location;\n url = search ? `${url}${search}` : url;\n url = hash ? `${url}${hash}` : url;\n }\n window.location.href = url;\n }\n }\n\n static async ClientRedirectToSignInPage(redirectPath) {\n if (typeof location === 'undefined') return;\n if (LoginHelper.WSFED_LOGIN) {\n await LoginHelper.WsFedLogout();\n await LoginHelper.WsFedLogin();\n } else {\n // Standard Contensis Login\n let url = LoginHelper.LOGIN_ROUTE;\n if (typeof redirectPath === 'string')\n url = `${url}?redirect_uri=${redirectPath}`;\n if (\n typeof location !== 'undefined' &&\n redirectPath !== LoginHelper.LOGIN_ROUTE\n )\n location.replace(url);\n }\n }\n\n static GetAccessDeniedRoute(originalPath) {\n let url = LoginHelper.ACCESS_DENIED_ROUTE;\n if (originalPath !== url && typeof originalPath === 'string')\n url = `${url}?original_uri=${originalPath}`;\n return url;\n }\n\n static ClientRedirectToAccessDeniedPage(originalPath) {\n if (typeof location !== 'undefined')\n location.href = LoginHelper.GetAccessDeniedRoute(originalPath);\n }\n\n static ClientRedirectToPath(redirectPath) {\n if (typeof redirectPath === 'string') {\n if (typeof location !== 'undefined') window.location.href = redirectPath;\n } else LoginHelper.ClientRedirectToHome();\n }\n\n static async WsFedLogin(redirectUri) {\n const userManager = await createUserManager(userManagerConfig);\n userManager.signinRedirect({\n scope: 'openid',\n response_type: 'id_token',\n redirect_uri: redirectUri || window.location.toString(),\n });\n }\n\n static RemoveSecurityTokenQuery() {\n const params = new URLSearchParams(window.location.search);\n if (params.has('securitytoken') || params.has('securityToken')) {\n params.delete('securitytoken');\n params.delete('securityToken');\n window.location = `${window.location.pathname}${\n params.toString() ? `?${params}` : ''\n }`;\n }\n }\n\n static async WsFedLogout(redirectPath) {\n await fetch(\n `${LoginHelper.CMS_URL}/authenticate/logout?jsonResponseRequired=true`,\n {\n credentials: 'include',\n }\n );\n if (redirectPath) {\n window.location = redirectPath;\n } else {\n // Explicitly check and remove any stale\n // security token that may be in the query string\n LoginHelper.RemoveSecurityTokenQuery();\n }\n }\n\n static async GetCredentialsForSecurityToken(securityToken) {\n const [error, response] = await to(\n fetch(`${LoginHelper.CMS_URL}/REST/Contensis/Security/IsAuthenticated`, {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n securityToken: encodeURIComponent(securityToken),\n }),\n })\n );\n if (error) return [{ message: 'Failed to fetch credentials' }];\n if (response.ok) {\n const [parseError, body] = await to(response.json());\n if (parseError) return [parseError];\n\n const { LogonResult, ApplicationData = [] } = body;\n if (LogonResult !== 0) {\n console.info(`Security token is invalid - LogonResult: ${LogonResult}`);\n return [\n { message: 'Security token is invalid', data: ApplicationData },\n ];\n }\n if (ApplicationData.length > 0) {\n let refreshToken;\n ApplicationData.forEach(item => {\n if (item.Key === 'ContensisSecurityRefreshToken')\n refreshToken = item.Value;\n });\n if (!refreshToken) {\n return [\n {\n message:\n 'Fetch credentials: Unable to find ContensisSecurityRefreshToken',\n },\n ];\n }\n return [undefined, refreshToken];\n } else {\n return [\n {\n message:\n 'Fetch credentials: Unable to find ContensisSecurityRefreshToken',\n },\n ];\n }\n } else {\n return [\n {\n message: `Fetch credentials error: ${response.status} ${response.statusText}`,\n },\n ];\n }\n }\n\n // static isZengentiStaff(email) {\n // const emailRefs = ['@zengenti', '@contensis'];\n\n // return emailRefs.some(emailRef => {\n // if (email.includes(emailRef)) {\n // return true;\n // }\n // });\n // }\n}\n","import { takeEvery, select, put, call } from 'redux-saga/effects';\nimport {\n SET_AUTHENTICATION_STATE,\n LOGIN_USER,\n LOGOUT_USER,\n VALIDATE_USER,\n} from '../types';\nimport {\n selectUserIsAuthenticated,\n selectClientCredentials,\n selectUserGroups,\n} from '../selectors';\n\nimport { setRoute } from '~/routing/redux/actions';\nimport { selectCurrentSearch } from '~/routing/redux/selectors';\nimport { findContentTypeMapping } from '~/routing/util/find-contenttype-mapping';\n\nimport mapClientCredentials from '~/user/transformations/mapClientCredentials';\n\nimport { getManagementApiClient } from '~/user/util/ContensisManagementApi';\nimport { LoginHelper } from '~/user/util/LoginHelper.class';\nimport { matchUserGroup } from '~/user/util/matchGroups';\nimport { queryParams } from '~/util/navigation';\n\nexport const loginSagas = [\n takeEvery(LOGIN_USER, loginUserSaga),\n takeEvery(LOGOUT_USER, logoutUserSaga),\n takeEvery(VALIDATE_USER, validateUserSaga),\n takeEvery(SET_AUTHENTICATION_STATE, redirectAfterSuccessfulLoginSaga),\n];\n\nexport function* handleRequiresLoginSaga(action) {\n const {\n cookies,\n entry,\n path,\n requireLogin,\n routes: { ContentTypeMappings },\n staticRoute,\n } = action;\n let userLoggedIn = yield select(selectUserIsAuthenticated);\n\n // Check for a securityToken in querystring\n const currentQs = queryParams(yield select(selectCurrentSearch));\n const securityToken = currentQs.securityToken || currentQs.securitytoken;\n\n // Check if any of the defined routes have \"requireLogin\" attribute\n const { requireLogin: authRoute } = (staticRoute && staticRoute.route) || {};\n const { requireLogin: authContentType } =\n (entry &&\n findContentTypeMapping(ContentTypeMappings, entry?.sys?.contentTypeId)) ||\n {};\n\n // If requireLogin, authRoute or authContentType has been specified as an\n // array of groups we can merge all the arrays and match on any group supplied\n const routeRequiresGroups = [\n ...((Array.isArray(authContentType) && authContentType) || []),\n ...((Array.isArray(authRoute) && authRoute) || []),\n ...((Array.isArray(requireLogin) && requireLogin) || []),\n ];\n const routeRequiresLogin = !!authContentType || !!authRoute || !!requireLogin;\n\n if (!userLoggedIn) {\n // If cookies or securityToken are found on any route change\n // always validate and login the user\n if (routeRequiresLogin) {\n console.info(`Route requires login: ${path}`);\n // If routeRequiresLogin do a blocking call that returns userLoggedIn\n userLoggedIn = yield call(validateUserSaga, {\n cookies,\n securityToken,\n });\n console.info(`User logged in: ${userLoggedIn}`);\n }\n // otherwise do a non blocking put to handle validation in the background\n else yield put({ type: VALIDATE_USER, cookies, securityToken });\n }\n\n if (routeRequiresLogin) {\n // If a security token is in the querystring and we are not already\n // logged in something is wrong and we won't bother going on another redirect loop\n if (!userLoggedIn && !securityToken) {\n LoginHelper.ClientRedirectToSignInPage(action.location.pathname);\n } else if (routeRequiresGroups.length > 0) {\n const userGroups = yield select(selectUserGroups, 'js');\n const groupMatch = matchUserGroup(userGroups, routeRequiresGroups);\n\n if (!groupMatch)\n LoginHelper.ClientRedirectToAccessDeniedPage(action.location.pathname);\n }\n }\n\n return userLoggedIn;\n}\n\nfunction* validateUserSaga({ cookies, securityToken }) {\n const login = LoginHelper.withCookies(cookies);\n // Check for refreshToken in cookies\n let clientCredentials = login.GetCachedCredentials();\n\n if (\n securityToken ||\n clientCredentials.securityToken ||\n clientCredentials.refreshToken\n ) {\n // We only attempt to validate the user if one of the stored\n // tokens are found, in this case we set loading state manually\n // so we don't need to set and unset loading if there are no stored\n yield put({\n type: SET_AUTHENTICATION_STATE,\n authenticationState: {\n isLoading: true,\n },\n });\n // If we have just a security token we will call a CMS endpoint\n // and provide us with a RefreshToken cookie we can use during login\n if (\n securityToken ||\n (clientCredentials.securityToken && !clientCredentials.refreshToken)\n ) {\n const [error, refreshToken] =\n yield LoginHelper.GetCredentialsForSecurityToken(\n securityToken || clientCredentials.securityToken\n );\n if (refreshToken) {\n // Set cookies and reload values\n login.SetLoginCookies({\n contensisClassicToken: securityToken,\n refreshToken,\n });\n clientCredentials = login.GetCachedCredentials();\n }\n if (error) {\n login.ClearCachedCredentials();\n yield put({\n type: SET_AUTHENTICATION_STATE,\n authenticationState: {\n isError: true,\n errorMessage:\n error?.message ||\n (error && 'toString' in error && error.toString()),\n },\n });\n }\n }\n\n // Log the user in if a refreshToken is found\n if (clientCredentials.refreshToken) {\n console.info(\n `Login user with refreshToken ${clientCredentials.refreshToken}`\n );\n yield call(loginUserSaga, {\n clientCredentials,\n cookies: login.cookies,\n });\n }\n }\n\n // Tell any callers have we successfully logged in?\n return yield select(selectUserIsAuthenticated);\n}\n\nfunction* loginUserSaga(action = {}) {\n const { username, password, clientCredentials, cookies } = action;\n const login = LoginHelper.withCookies(cookies);\n\n // If a WSFED_LOGIN site has dispatched the loginUser action\n // just redirect them to the Identity Provider sign in\n if (action.type === LOGIN_USER && LoginHelper.WSFED_LOGIN)\n LoginHelper.ClientRedirectToSignInPage();\n\n const { authenticationState, user } = yield login.LoginUser({\n username,\n password,\n clientCredentials,\n });\n\n yield put({\n type: SET_AUTHENTICATION_STATE,\n authenticationState,\n user,\n });\n}\n\nconst removeHostnamePart = path => {\n // eslint-disable-next-line no-console\n console.log(path);\n const relativePath = '/' + path.split('/').splice(3).join('/');\n // eslint-disable-next-line no-console\n console.log(relativePath);\n return relativePath;\n};\n\nfunction* redirectAfterSuccessfulLoginSaga() {\n const isLoggedIn = yield select(selectUserIsAuthenticated);\n const { redirect_uri: redirectPath, ReturnURL: assetRedirectPath } =\n queryParams(yield select(selectCurrentSearch));\n\n if (isLoggedIn && assetRedirectPath && typeof window != 'undefined') {\n const path = removeHostnamePart(assetRedirectPath);\n // This has to be a hard href to get the app to\n // leave React and hit the server for the IIS hosted assets\n window.location.href = path;\n // yield put(setRoute(path)); // does not work in this scenario\n } else if (isLoggedIn && redirectPath) {\n yield put(setRoute(redirectPath));\n }\n}\n\nfunction* logoutUserSaga({ redirectPath, cookies }) {\n yield put({\n type: SET_AUTHENTICATION_STATE,\n user: null,\n });\n yield LoginHelper.withCookies(cookies).LogoutUser(redirectPath);\n}\n\nexport function* refreshSecurityToken() {\n const clientCredentials = yield select(selectClientCredentials, 'js');\n if (Object.keys(clientCredentials).length > 0) {\n const client = yield getManagementApiClient(clientCredentials);\n yield client.authenticate();\n\n yield put({\n type: SET_AUTHENTICATION_STATE,\n authenticationState: {\n clientCredentials: mapClientCredentials(client),\n },\n });\n }\n}\n","import { action } from '~/redux/util';\nimport {\n CHANGE_USER_PASSWORD,\n LOGIN_USER,\n LOGOUT_USER,\n REGISTER_USER,\n REQUEST_USER_PASSWORD_RESET,\n RESET_USER_PASSWORD,\n} from './types';\n\nexport const loginUser = (username, password, cookies) =>\n action(LOGIN_USER, { username, password, cookies });\n\nexport const logoutUser = (redirectPath, cookies) =>\n action(LOGOUT_USER, { redirectPath, cookies });\n\nexport const registerUser = (user, mappers) =>\n action(REGISTER_USER, {\n user,\n mappers,\n });\n\nexport const requestPasswordReset = userEmailObject =>\n action(REQUEST_USER_PASSWORD_RESET, { userEmailObject });\n\nexport const resetPassword = resetPasswordObject =>\n action(RESET_USER_PASSWORD, { resetPasswordObject });\n\nexport const changePassword = (userId, currentPassword, newPassword) =>\n action(CHANGE_USER_PASSWORD, { userId, currentPassword, newPassword });\n","import { useCookies } from 'react-cookie';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { loginUser, logoutUser } from '../redux/actions';\nimport {\n selectUser,\n selectUserIsAuthenticationError,\n selectUserIsError,\n selectUserErrorMessage,\n selectUserIsAuthenticated,\n selectUserIsLoading,\n} from '../redux/selectors';\nimport { CookieHelper } from '../util/CookieHelper.class';\n\nconst useLogin = () => {\n const cookies = new CookieHelper(...useCookies());\n\n const dispatch = useDispatch();\n const select = useSelector;\n\n return {\n loginUser: (username, password) =>\n dispatch(loginUser(username, password, cookies)),\n logoutUser: redirectPath => dispatch(logoutUser(redirectPath, cookies)),\n errorMessage: select(selectUserErrorMessage),\n isAuthenticated: select(selectUserIsAuthenticated),\n isAuthenticationError: select(selectUserIsAuthenticationError),\n isError: select(selectUserIsError),\n isLoading: select(selectUserIsLoading),\n user: select(selectUser),\n // DEPRECATED: authenticationError is deprecated use isAuthenticationError instead\n authenticationError: select(selectUserIsAuthenticationError),\n // DEPRECATED: authenticationErrorMessage is deprecated use errorMessage instead\n authenticationErrorMessage: select(selectUserErrorMessage),\n // DEPRECATED: error is deprecated use isError instead\n error: select(selectUserIsError),\n };\n};\n\nexport default useLogin;\n","import useLogin from '../hooks/useLogin';\nimport { toJS } from '~/util/ToJs';\n\nconst LoginContainer = ({ children, ...props }) => {\n const userProps = useLogin(props);\n return children(userProps);\n};\n\nLoginContainer.propTypes = {};\n\nexport default toJS(LoginContainer);\n","import { useDispatch, useSelector } from 'react-redux';\nimport { registerUser } from '../redux/actions';\nimport {\n selectUserRegistration,\n selectUserRegistrationError,\n selectUserRegistrationIsLoading,\n selectUserRegistrationIsSuccess,\n} from '../redux/selectors';\n\nconst useRegistration = () => {\n const dispatch = useDispatch();\n const select = useSelector;\n\n return {\n registerUser: (user, mappers) => dispatch(registerUser(user, mappers)),\n error: select(selectUserRegistrationError),\n isLoading: select(selectUserRegistrationIsLoading),\n isSuccess: select(selectUserRegistrationIsSuccess),\n user: select(selectUserRegistration),\n };\n};\n\nexport default useRegistration;\n","import useRegistration from '../hooks/useRegistration';\nimport { toJS } from '~/util/ToJs';\n\nconst RegistrationContainer = ({ children, ...props }) => {\n const userProps = useRegistration(props);\n return children(userProps);\n};\n\nRegistrationContainer.propTypes = {};\n\nexport default toJS(RegistrationContainer);\n","import { useDispatch, useSelector } from 'react-redux';\nimport { requestPasswordReset, resetPassword } from '../redux/actions';\nimport {\n selectPasswordResetRequestError,\n selectPasswordResetRequestSending,\n selectPasswordResetRequestSent,\n selectResetPasswordSending,\n selectResetPasswordSent,\n selectResetPasswordError,\n} from '../redux/selectors';\nimport { selectCurrentSearch } from '~/routing/redux/selectors';\n\nconst useForgotPassword = () => {\n const dispatch = useDispatch();\n const select = useSelector;\n\n return {\n isLoading: select(selectPasswordResetRequestSending),\n isSuccess: select(selectPasswordResetRequestSent),\n error: select(selectPasswordResetRequestError),\n requestPasswordReset: userEmailObject =>\n dispatch(requestPasswordReset(userEmailObject)),\n\n setNewPassword: {\n queryString: select(selectCurrentSearch),\n isLoading: select(selectResetPasswordSending),\n isSuccess: select(selectResetPasswordSent),\n error: select(selectResetPasswordError),\n submit: resetPasswordObject =>\n dispatch(resetPassword(resetPasswordObject)),\n },\n };\n};\n\nexport default useForgotPassword;\n","import useForgotPassword from '../hooks/useForgotPassword';\nimport { toJS } from '~/util/ToJs';\n\nconst ForgotPasswordContainer = ({ children, ...props }) => {\n const userProps = useForgotPassword(props);\n return children(userProps);\n};\n\nForgotPasswordContainer.propTypes = {};\n\nexport default toJS(ForgotPasswordContainer);\n","import { useDispatch, useSelector } from 'react-redux';\nimport { changePassword } from '../redux/actions';\nimport {\n selectChangePasswordSending,\n selectChangePasswordSent,\n selectChangePasswordError,\n selectUserIsAuthenticated,\n selectUserGuid,\n} from '../redux/selectors';\n\nconst useChangePassword = () => {\n const dispatch = useDispatch();\n const select = useSelector;\n\n return {\n isLoading: select(selectChangePasswordSending),\n isSuccess: select(selectChangePasswordSent),\n userId: select(selectUserGuid),\n isLoggedIn: select(selectUserIsAuthenticated),\n error: select(selectChangePasswordError),\n changePassword: (userId, currentPassword, newPassword) =>\n dispatch(changePassword(userId, currentPassword, newPassword)),\n };\n};\n\nexport default useChangePassword;\n","import useChangePassword from '../hooks/useChangePassword';\nimport { toJS } from '~/util/ToJs';\n\nconst ChangePasswordContainer = ({ children, ...props }) => {\n const userProps = useChangePassword(props);\n return children(userProps);\n};\n\nChangePasswordContainer.propTypes = {};\n\nexport default toJS(ChangePasswordContainer);\n"],"names":["findContentTypeMapping","ContentTypeMappings","contentTypeId","find","ct","contentTypeID","clientCredentials","bearerToken","bearerTokenExpiryDate","toISOString","refreshToken","refreshTokenExpiryDate","contensisClassicToken","obj","mapJson","getManagementApiClient","username","password","rootUrl","SERVERS","api","cms","projectId","PROJECTS","id","config","clientType","clientDetails","Client","window","UniversalClient","client","create","context","global","requireOidc","process","env","NODE_ENV","WSFED_LOGIN","servers","userManagerConfig","authority","client_id","redirect_uri","location","toString","post_logout_redirect_uri","response_type","scope","filterProtocolClaims","createUserManager","UserManager","e","console","error","LoginHelper","constructor","cookies","SetLoginCookies","info","LOGIN_COOKIE","REFRESH_TOKEN_COOKIE","SetCookie","GetCachedCredentials","GetCookie","ClearCachedCredentials","DeleteCookie","localStorage","keys","i","length","key","startsWith","push","forEach","removeItem","LoginUser","credentials","authenticationState","isAuthenticated","isAuthenticationError","isError","transientClient","user","loginError","clientBearerToken","to","ensureBearerToken","errorMessage","message","name","includes","mapClientCredentials","userDetails","GetUserDetails","latestCredentials","LogoutUser","redirectPath","WsFedLogout","ClientRedirectToPath","ClientRedirectToSignInPage","ClientRedirectToHome","url","search","hash","href","WsFedLogin","LOGIN_ROUTE","replace","GetAccessDeniedRoute","originalPath","ACCESS_DENIED_ROUTE","ClientRedirectToAccessDeniedPage","redirectUri","userManager","signinRedirect","RemoveSecurityTokenQuery","params","URLSearchParams","has","delete","pathname","fetch","CMS_URL","GetCredentialsForSecurityToken","securityToken","response","method","headers","Accept","body","JSON","stringify","encodeURIComponent","ok","parseError","json","LogonResult","ApplicationData","data","item","Key","Value","undefined","status","statusText","withCookies","cookieHelper","userError","groupsError","groupsResult","security","users","getCurrent","getUserGroups","userId","includeInherited","pageOptions","pageSize","items","groups","log","loginSagas","takeEvery","LOGIN_USER","loginUserSaga","LOGOUT_USER","logoutUserSaga","VALIDATE_USER","validateUserSaga","SET_AUTHENTICATION_STATE","redirectAfterSuccessfulLoginSaga","handleRequiresLoginSaga","action","entry","path","requireLogin","routes","staticRoute","userLoggedIn","select","selectUserIsAuthenticated","currentQs","queryParams","selectCurrentSearch","securitytoken","authRoute","route","authContentType","sys","routeRequiresGroups","Array","isArray","routeRequiresLogin","call","put","type","userGroups","selectUserGroups","groupMatch","matchUserGroup","login","isLoading","removeHostnamePart","relativePath","split","splice","join","isLoggedIn","ReturnURL","assetRedirectPath","setRoute","refreshSecurityToken","selectClientCredentials","Object","authenticate","loginUser","logoutUser","registerUser","mappers","REGISTER_USER","requestPasswordReset","userEmailObject","REQUEST_USER_PASSWORD_RESET","resetPassword","resetPasswordObject","RESET_USER_PASSWORD","changePassword","currentPassword","newPassword","CHANGE_USER_PASSWORD","useLogin","CookieHelper","useCookies","dispatch","useDispatch","useSelector","selectUserErrorMessage","selectUserIsAuthenticationError","selectUserIsError","selectUserIsLoading","selectUser","authenticationError","authenticationErrorMessage","LoginContainer","children","props","userProps","propTypes","toJS","useRegistration","selectUserRegistrationError","selectUserRegistrationIsLoading","isSuccess","selectUserRegistrationIsSuccess","selectUserRegistration","RegistrationContainer","useForgotPassword","selectPasswordResetRequestSending","selectPasswordResetRequestSent","selectPasswordResetRequestError","setNewPassword","queryString","selectResetPasswordSending","selectResetPasswordSent","selectResetPasswordError","submit","ForgotPasswordContainer","useChangePassword","selectChangePasswordSending","selectChangePasswordSent","selectUserGuid","selectChangePasswordError","ChangePasswordContainer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAEaA,sBAAsB,GAAG,CACpCC,mBADoC,EAEpCC,aAFoC,KAGjCD,mBAAmB,CAACE,IAApB,CAAyBC,EAAE,IAAIA,EAAE,CAACC,aAAH,KAAqBH,aAApD;;ACHL,MAAMI,iBAAiB,GAAG;AACxBC,EAAAA,WAAW,EAAE,aADW;AAExB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M4C,uBAAuB,GAAG,CAAC;EAAE5B,QAAF;EAAY,GAAGC,KAAAA;AAAf,CAAD,KAA4B;AAC1D,EAAA,MAAMC,SAAS,GAAGqB,iBAAiB,CAAA,CAAnC,CAAA;EACA,OAAOvB,QAAQ,CAACE,SAAD,CAAf,CAAA;AACD,CAHD,CAAA;;AAKA0B,uBAAuB,CAACzB,SAAxB,GAAoC,EAApC,CAAA;AAEA,+BAAeC,SAAI,CAACwB,uBAAD,CAAnB;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var contensisDeliveryApi = require('contensis-delivery-api');
|
|
4
4
|
var queryString = require('query-string');
|
|
5
|
-
var selectors = require('./selectors-
|
|
6
|
-
var version = require('./version-
|
|
5
|
+
var selectors = require('./selectors-14caa813.js');
|
|
6
|
+
var version = require('./version-34d91f68.js');
|
|
7
7
|
var CookieConstants = require('./CookieConstants-000427db.js');
|
|
8
8
|
|
|
9
9
|
class CacheNode {
|
|
@@ -13,7 +13,9 @@ class CacheNode {
|
|
|
13
13
|
this.next = null;
|
|
14
14
|
this.prev = null;
|
|
15
15
|
}
|
|
16
|
+
|
|
16
17
|
}
|
|
18
|
+
|
|
17
19
|
class LruCache {
|
|
18
20
|
constructor(limit = 100) {
|
|
19
21
|
this.map = {};
|
|
@@ -22,6 +24,7 @@ class LruCache {
|
|
|
22
24
|
this.limit = limit || 100;
|
|
23
25
|
this.size = 0;
|
|
24
26
|
}
|
|
27
|
+
|
|
25
28
|
get(key) {
|
|
26
29
|
if (this.map[key]) {
|
|
27
30
|
let value = this.map[key].value;
|
|
@@ -31,8 +34,10 @@ class LruCache {
|
|
|
31
34
|
return value;
|
|
32
35
|
}
|
|
33
36
|
}
|
|
37
|
+
|
|
34
38
|
set(key, value) {
|
|
35
39
|
let node = new CacheNode(key, value);
|
|
40
|
+
|
|
36
41
|
if (this.map[key]) {
|
|
37
42
|
this.remove(key);
|
|
38
43
|
} else {
|
|
@@ -43,21 +48,28 @@ class LruCache {
|
|
|
43
48
|
this.tail.next = null;
|
|
44
49
|
}
|
|
45
50
|
}
|
|
51
|
+
|
|
46
52
|
this.setHead(node);
|
|
47
53
|
}
|
|
54
|
+
|
|
48
55
|
setHead(node) {
|
|
49
56
|
node.next = this.head;
|
|
50
57
|
node.prev = null;
|
|
58
|
+
|
|
51
59
|
if (this.head) {
|
|
52
60
|
this.head.prev = node;
|
|
53
61
|
}
|
|
62
|
+
|
|
54
63
|
this.head = node;
|
|
64
|
+
|
|
55
65
|
if (!this.tail) {
|
|
56
66
|
this.tail = node;
|
|
57
67
|
}
|
|
68
|
+
|
|
58
69
|
this.size++;
|
|
59
70
|
this.map[node.key] = node;
|
|
60
71
|
}
|
|
72
|
+
|
|
61
73
|
remove(key) {
|
|
62
74
|
let node = this.map[key];
|
|
63
75
|
if (!node) return; // This is sometimes null and crashes the container without this check
|
|
@@ -67,14 +79,17 @@ class LruCache {
|
|
|
67
79
|
} else {
|
|
68
80
|
this.head = node.next;
|
|
69
81
|
}
|
|
82
|
+
|
|
70
83
|
if (node.next) {
|
|
71
84
|
node.next.prev = node.prev;
|
|
72
85
|
} else {
|
|
73
86
|
this.tail = node.prev;
|
|
74
87
|
}
|
|
88
|
+
|
|
75
89
|
delete this.map[key];
|
|
76
90
|
this.size--;
|
|
77
91
|
}
|
|
92
|
+
|
|
78
93
|
}
|
|
79
94
|
|
|
80
95
|
// CachedSearch does not cache results in SSR by design
|
|
@@ -84,17 +99,21 @@ class CachedSearch {
|
|
|
84
99
|
this.cookies = void 0;
|
|
85
100
|
this.cookies = cookies;
|
|
86
101
|
}
|
|
102
|
+
|
|
87
103
|
getClient(...args) {
|
|
88
104
|
return new DeliveryApi(this.cookies).getClient(...args);
|
|
89
105
|
}
|
|
106
|
+
|
|
90
107
|
search(query, linkDepth = 0, project) {
|
|
91
108
|
const client = contensisDeliveryApi.Client.create(getClientConfig(project, this.cookies));
|
|
92
109
|
return this.request(`${project}+${JSON.stringify(query)}+${linkDepth}`, () => client.entries.search(query, linkDepth));
|
|
93
110
|
}
|
|
111
|
+
|
|
94
112
|
searchUsingPost(query, linkDepth = 0, project = '') {
|
|
95
113
|
const client = contensisDeliveryApi.Client.create(getClientConfig(project, this.cookies));
|
|
96
114
|
return this.request(`${project}+${JSON.stringify(query)}+${linkDepth}`, () => client.entries.searchUsingPost(query, linkDepth));
|
|
97
115
|
}
|
|
116
|
+
|
|
98
117
|
get(id, linkDepth = 0, versionStatus = 'published', project) {
|
|
99
118
|
const client = contensisDeliveryApi.Client.create(getClientConfig(project, this.cookies));
|
|
100
119
|
client.clientConfig.versionStatus = versionStatus;
|
|
@@ -103,30 +122,37 @@ class CachedSearch {
|
|
|
103
122
|
linkDepth
|
|
104
123
|
}));
|
|
105
124
|
}
|
|
125
|
+
|
|
106
126
|
getContentType(id, project) {
|
|
107
127
|
const client = contensisDeliveryApi.Client.create(getClientConfig(project, this.cookies));
|
|
108
128
|
return this.request(`[CONTENT TYPE] ${id} ${project}`, () => client.contentTypes.get(id));
|
|
109
129
|
}
|
|
130
|
+
|
|
110
131
|
getRootNode(options, project) {
|
|
111
132
|
const client = contensisDeliveryApi.Client.create(getClientConfig(project, this.cookies));
|
|
112
133
|
return this.request(`${project} / ${JSON.stringify(options)}`, () => client.nodes.getRoot(options));
|
|
113
134
|
}
|
|
135
|
+
|
|
114
136
|
getNode(options, project) {
|
|
115
137
|
const client = contensisDeliveryApi.Client.create(getClientConfig(project, this.cookies));
|
|
116
138
|
return this.request(`${project} ${options && typeof options !== 'string' ? 'path' in options ? options.path : options.id : options} ${JSON.stringify(options)}`, () => client.nodes.get(options));
|
|
117
139
|
}
|
|
140
|
+
|
|
118
141
|
getAncestors(options, project) {
|
|
119
142
|
const client = contensisDeliveryApi.Client.create(getClientConfig(project, this.cookies));
|
|
120
143
|
return this.request(`${project} [A] ${options && typeof options !== 'string' && options.id || options} ${JSON.stringify(options)}`, () => client.nodes.getAncestors(options));
|
|
121
144
|
}
|
|
145
|
+
|
|
122
146
|
getChildren(options, project) {
|
|
123
147
|
const client = contensisDeliveryApi.Client.create(getClientConfig(project, this.cookies));
|
|
124
148
|
return this.request(`${project} [C] ${options && typeof options !== 'string' && options.id || options} ${JSON.stringify(options)}`, () => client.nodes.getChildren(options));
|
|
125
149
|
}
|
|
150
|
+
|
|
126
151
|
getSiblings(options, project) {
|
|
127
152
|
const client = contensisDeliveryApi.Client.create(getClientConfig(project, this.cookies));
|
|
128
153
|
return this.request(`${project} [S] ${options && typeof options !== 'string' && options.id || options} ${JSON.stringify(options)}`, () => client.nodes.getSiblings(options));
|
|
129
154
|
}
|
|
155
|
+
|
|
130
156
|
request(key, execute) {
|
|
131
157
|
// do not cache results in SSR
|
|
132
158
|
if (!this.cache.get(key) || typeof window == 'undefined') {
|
|
@@ -136,86 +162,107 @@ class CachedSearch {
|
|
|
136
162
|
this.cache.remove(key);
|
|
137
163
|
});
|
|
138
164
|
}
|
|
165
|
+
|
|
139
166
|
return this.cache.get(key);
|
|
140
167
|
}
|
|
168
|
+
|
|
141
169
|
}
|
|
170
|
+
|
|
142
171
|
const cachedSearch = new CachedSearch();
|
|
143
172
|
const cachedSearchWithCookies = cookies => new CachedSearch(cookies);
|
|
144
173
|
|
|
145
174
|
const mapCookieHeader = cookies => typeof cookies === 'object' ? Object.entries(cookies).map(([name, value]) => `${name}=${value}`).join('; ') : cookies;
|
|
175
|
+
|
|
146
176
|
const getSsrReferer = () => {
|
|
147
177
|
if (typeof window === 'undefined') {
|
|
148
178
|
const state = version.reduxStore.getState();
|
|
149
179
|
const referer = `${selectors.selectCurrentHostname(state)}${selectors.selectCurrentPath(state)}${selectors.selectCurrentSearch(state)}`;
|
|
150
180
|
return referer;
|
|
151
181
|
}
|
|
182
|
+
|
|
152
183
|
return '';
|
|
153
184
|
};
|
|
185
|
+
|
|
154
186
|
const storeSurrogateKeys = response => {
|
|
155
187
|
const keys = response.headers.get ? response.headers.get('surrogate-key') : response.headers.map['surrogate-key'];
|
|
156
188
|
if (keys) version.reduxStore === null || version.reduxStore === void 0 ? void 0 : version.reduxStore.dispatch(selectors.setSurrogateKeys(keys, response.url));
|
|
157
189
|
};
|
|
190
|
+
|
|
158
191
|
const getClientConfig = (project, cookies) => {
|
|
159
|
-
const config = DELIVERY_API_CONFIG;
|
|
192
|
+
const config = DELIVERY_API_CONFIG;
|
|
193
|
+
/* global DELIVERY_API_CONFIG */
|
|
194
|
+
|
|
160
195
|
config.responseHandler = {};
|
|
196
|
+
|
|
161
197
|
if (project) {
|
|
162
198
|
config.projectId = project;
|
|
163
|
-
}
|
|
199
|
+
} // we only want the surrogate key header in a server context
|
|
200
|
+
|
|
164
201
|
|
|
165
|
-
// we only want the surrogate key header in a server context
|
|
166
202
|
if (typeof window === 'undefined') {
|
|
167
203
|
config.defaultHeaders = Object.assign(config.defaultHeaders || {}, {
|
|
168
204
|
referer: getSsrReferer(),
|
|
169
205
|
'x-require-surrogate-key': true,
|
|
170
206
|
'x-crb-ssr': true // add this for support tracing
|
|
171
|
-
});
|
|
172
207
|
|
|
208
|
+
});
|
|
173
209
|
config.responseHandler[200] = storeSurrogateKeys;
|
|
174
210
|
}
|
|
175
|
-
|
|
211
|
+
|
|
212
|
+
if (typeof window !== 'undefined' && PROXY_DELIVERY_API
|
|
213
|
+
/* global PROXY_DELIVERY_API */
|
|
214
|
+
) {
|
|
176
215
|
// ensure a relative url is used to bypass the need for CORS (separate OPTIONS calls)
|
|
177
216
|
config.rootUrl = '';
|
|
217
|
+
|
|
178
218
|
config.responseHandler[404] = () => null;
|
|
179
219
|
}
|
|
220
|
+
|
|
180
221
|
if (cookies) {
|
|
181
222
|
const cookieHeader = mapCookieHeader(CookieConstants.findLoginCookies(cookies));
|
|
223
|
+
|
|
182
224
|
if (cookieHeader) {
|
|
183
225
|
config.defaultHeaders = Object.assign(config.defaultHeaders || {}, {
|
|
184
226
|
Cookie: cookieHeader
|
|
185
227
|
});
|
|
186
228
|
}
|
|
187
229
|
}
|
|
188
|
-
return config;
|
|
189
|
-
};
|
|
190
230
|
|
|
191
|
-
|
|
231
|
+
return config;
|
|
232
|
+
}; // export * from 'contensis-delivery-api';
|
|
192
233
|
|
|
193
234
|
class DeliveryApi {
|
|
194
235
|
constructor(cookies) {
|
|
195
236
|
this.cookies = void 0;
|
|
237
|
+
|
|
196
238
|
this.getClientSideVersionStatus = () => {
|
|
197
239
|
if (typeof window !== 'undefined') {
|
|
198
240
|
// Allow overriding versionStatus with the querystring
|
|
199
241
|
const {
|
|
200
242
|
versionStatus
|
|
201
243
|
} = queryString.parse(window.location.search);
|
|
202
|
-
if (versionStatus) return versionStatus;
|
|
203
|
-
|
|
204
|
-
if (typeof window.versionStatus !== 'undefined') return window.versionStatus;
|
|
205
|
-
|
|
244
|
+
if (versionStatus) return versionStatus; // Client-side we will have a global variable set if rendered by SSR in production
|
|
245
|
+
|
|
246
|
+
if (typeof window.versionStatus !== 'undefined') return window.versionStatus; // For localhost development we can only work out versionStatus from the current hostname
|
|
247
|
+
|
|
206
248
|
const currentHostname = window.location.hostname;
|
|
207
249
|
return this.getVersionStatusFromHostname(currentHostname);
|
|
208
250
|
}
|
|
251
|
+
|
|
209
252
|
return null;
|
|
210
253
|
};
|
|
254
|
+
|
|
211
255
|
this.getServerSideVersionStatus = request => request.query.versionStatus || deliveryApi.getVersionStatusFromHeaders(request.headers) || deliveryApi.getVersionStatusFromHostname(request.hostname);
|
|
256
|
+
|
|
212
257
|
this.getVersionStatusFromHeaders = headers => {
|
|
213
258
|
const versionStatusHeader = headers['x-entry-versionstatus'];
|
|
214
259
|
if (typeof versionStatusHeader !== 'undefined') return versionStatusHeader;
|
|
215
260
|
return null;
|
|
216
261
|
};
|
|
262
|
+
|
|
217
263
|
this.getVersionStatusFromHostname = currentHostname => {
|
|
218
264
|
if (currentHostname.indexOf('localhost') > -1) return 'latest';
|
|
265
|
+
|
|
219
266
|
if (currentHostname.endsWith('contensis.cloud')) {
|
|
220
267
|
if (currentHostname.indexOf('preview.') > -1) {
|
|
221
268
|
return 'latest';
|
|
@@ -223,6 +270,7 @@ class DeliveryApi {
|
|
|
223
270
|
return 'published';
|
|
224
271
|
}
|
|
225
272
|
}
|
|
273
|
+
|
|
226
274
|
if (currentHostname.endsWith('cloud.contensis.com')) {
|
|
227
275
|
if (currentHostname.indexOf('preview-') > -1) {
|
|
228
276
|
return 'latest';
|
|
@@ -230,29 +278,35 @@ class DeliveryApi {
|
|
|
230
278
|
return 'published';
|
|
231
279
|
}
|
|
232
280
|
}
|
|
281
|
+
|
|
233
282
|
return 'published';
|
|
234
283
|
};
|
|
284
|
+
|
|
235
285
|
this.search = (query, linkDepth = 0, project) => {
|
|
236
286
|
const client = contensisDeliveryApi.Client.create(getClientConfig(project, this.cookies));
|
|
237
287
|
return client.entries.search(query, typeof linkDepth !== 'undefined' ? linkDepth : 1);
|
|
238
288
|
};
|
|
289
|
+
|
|
239
290
|
this.getClient = (versionStatus = 'published', project) => {
|
|
240
291
|
const baseConfig = getClientConfig(project, this.cookies);
|
|
241
292
|
baseConfig.versionStatus = versionStatus;
|
|
242
293
|
return contensisDeliveryApi.Client.create(baseConfig);
|
|
243
294
|
};
|
|
295
|
+
|
|
244
296
|
this.getEntry = (id, linkDepth = 0, versionStatus = 'published', project) => {
|
|
245
297
|
const baseConfig = getClientConfig(project, this.cookies);
|
|
246
298
|
baseConfig.versionStatus = versionStatus;
|
|
247
|
-
const client = contensisDeliveryApi.Client.create(baseConfig);
|
|
248
|
-
|
|
299
|
+
const client = contensisDeliveryApi.Client.create(baseConfig); // return client.entries.get(id, linkDepth);
|
|
300
|
+
|
|
249
301
|
return client.entries.get({
|
|
250
302
|
id,
|
|
251
303
|
linkDepth
|
|
252
304
|
});
|
|
253
305
|
};
|
|
306
|
+
|
|
254
307
|
this.cookies = cookies;
|
|
255
308
|
}
|
|
309
|
+
|
|
256
310
|
}
|
|
257
311
|
const deliveryApi = new DeliveryApi();
|
|
258
312
|
const deliveryApiWithCookies = cookies => new DeliveryApi(cookies);
|
|
@@ -262,4 +316,4 @@ exports.cachedSearchWithCookies = cachedSearchWithCookies;
|
|
|
262
316
|
exports.deliveryApi = deliveryApi;
|
|
263
317
|
exports.deliveryApiWithCookies = deliveryApiWithCookies;
|
|
264
318
|
exports.getClientConfig = getClientConfig;
|
|
265
|
-
//# sourceMappingURL=ContensisDeliveryApi-
|
|
319
|
+
//# sourceMappingURL=ContensisDeliveryApi-4fcf049d.js.map
|