Skip to content

Commit

Permalink
Merge pull request #2581 from Hyperkid123/retrieve-sso-url
Browse files Browse the repository at this point in the history
Start consuming SSO url from generated FEO config.
  • Loading branch information
Hyperkid123 authored Jul 20, 2023
2 parents 6e85e9c + 74c7484 commit 8c4befa
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/utils/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,15 +338,25 @@ export function getChromeStaticPathname(type: 'modules' | 'navigation' | 'servic
return `${CHROME_SERVICE_BASE}${chromeServiceStaticPathname[stableEnv][prodEnv]}/${type}`;
}

function getChromeDynamicPaths() {
return `${isBeta() ? '/beta' : ''}/apps/chrome/operator-generated/fed-modules.json`;
}

const fedModulesheaders = {
'Cache-Control': 'no-cache',
Pragma: 'no-cache',
Expires: '0',
};

export const loadFedModules = async () =>
axios.get(`${getChromeStaticPathname('modules')}/fed-modules.json`, {
headers: fedModulesheaders,
Promise.all([
axios.get(`${getChromeStaticPathname('modules')}/fed-modules.json`, {
headers: fedModulesheaders,
}),
axios.get(getChromeDynamicPaths()).catch(() => ({ data: {} })),
]).then(([staticConfig, feoConfig]) => {
staticConfig.data.chrome = feoConfig?.data?.chrome;
return staticConfig;
});

export const generateRoutesList = (modules: { [key: string]: ChromeModule }) =>
Expand Down

0 comments on commit 8c4befa

Please sign in to comment.