diff --git a/src/common/api/Keycloak.js b/src/common/api/Keycloak.js index f723ce770..305bf58e6 100644 --- a/src/common/api/Keycloak.js +++ b/src/common/api/Keycloak.js @@ -4,6 +4,29 @@ let keycloak = null let isInitialized = false let initPromise = null +let keycloakRedirect = null +let hostname = window.location.hostname + +if (hostname == 'ffiec.beta.cfpb.gov') { + keycloakRedirect = 'ffiec.cfpb.gov' +} else if (hostname.includes('4-beta')) { + keycloakRedirect = hostname.replace('4-beta.demo', 'dev') +} else if (hostname.includes('-beta')) { + keycloakRedirect = hostname.replace('-beta', '') +} else { + keycloakRedirect = hostname +} + +const keycloakConfig = { + "realm": "hmda2", + "url": `https://${keycloakRedirect}/auth`, + "clientId": "hmda2-api", + "public-client": true, + "use-resource-role-mappings": true, + "confidential-port": 0, + "ssl-required": "all" +} + export const setKeycloak = (cloak) => { keycloak = cloak return keycloak @@ -28,12 +51,12 @@ export const initKeycloak = (overrides) => { } else if (import.meta.env.MODE === 'development') { keycloak = new Keycloak('/local_keycloak.json') } else { - keycloak = new Keycloak('/keycloak.json') + keycloak = new Keycloak(keycloakConfig) } } initPromise = keycloak - .init({ pkceMethod: 'S256' }) + .init({ pkceMethod: 'S256', checkLoginIframe: false }) .then((authenticated) => { console.log('Keycloak initialized, authenticated:', authenticated) isInitialized = true diff --git a/src/common/constants/prod-beta-config.json b/src/common/constants/prod-beta-config.json index efa1383bf..f40eb70aa 100644 --- a/src/common/constants/prod-beta-config.json +++ b/src/common/constants/prod-beta-config.json @@ -1,21 +1,9 @@ { "name": "prod-beta", - "announcement": [ - { - "message": "Our beta platform is currently unavailable.", - "type": "error", - "heading": "System Temporarily Unavailable", - "link": null - } - ], + "announcement": null, "publicationReleaseYear": "2020", - "maintenanceMode": true, - "filingAnnouncement": { - "message": "Our beta platform is currently unavailable.", - "type": "error", - "heading": "System Temporarily Unavailable", - "endDate": null - }, + "maintenanceMode": false, + "filingAnnouncement": null, "ffvtAnnouncement": null, "dataPublicationYears": { "shared": [ @@ -80,10 +68,10 @@ "annual": "01/01/2025 - 03/03/2025 - 12/31/2027" }, "2025": { - "Q1": "04/01/2025 - 05/30/2025 - 06/30/2025", + "Q1": "01/01/2025 - 06/30/2025 - 06/30/2025", "Q2": "07/01/2025 - 08/29/2025 - 09/30/2025", "Q3": "10/01/2025 - 12/01/2025 - 12/31/2025", - "annual": "01/01/2026 - 03/02/2026 - 12/31/2028" + "annual": "01/01/2025 - 03/02/2026 - 12/31/2028" }, "2026": { "Q1": "04/01/2026 - 06/01/2026 - 07/02/2026", @@ -121,7 +109,9 @@ "2023-Q1", "2023-Q2", "2024", - "2024-Q1" + "2024-Q1", + "2025", + "2025-Q1" ] } -} +} \ No newline at end of file diff --git a/src/common/useEnvironmentConfig.jsx b/src/common/useEnvironmentConfig.jsx index 683e01fc4..09b4d3a20 100644 --- a/src/common/useEnvironmentConfig.jsx +++ b/src/common/useEnvironmentConfig.jsx @@ -4,11 +4,11 @@ import { fetchEnvConfig, getDefaultConfig } from './configUtils' export function useEnvironmentConfig(host) { const [config, setConfig] = useState(getDefaultConfig(host)) - useEffect(() => { - if (window.location.hostname !== 'localhost') { - fetchEnvConfig(setConfig, host).catch(() => null) - } - }, [host]) +// useEffect(() => { +// if (window.location.hostname !== 'localhost') { +// fetchEnvConfig(setConfig, host).catch(() => null) +// } +// }, [host]) return config }