Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const params = new SkyAppRuntimeConfigParams(
currentUrl,
this.config.params!
);
const ensureContextArgs: BBContextArgs = {
envId: params.get('envid'),
envIdRequired: params.isRequired('envid'),
leId: params.get('leid'),
leIdRequired: params.isRequired('leid'),
svcId: params.get('svcid'),
svcIdRequired: params.isRequired('svcid'),
url: currentUrl
};
return BBContextProvider.ensureContext(ensureContextArgs)
.then((args) => {
// The URL will remain the same if the required context is already present, in which
// case there's no need to update the URL.
if (args.url !== currentUrl) {
history.replaceState(
{},
'',
args.url
);
}
});
});
} else {
this.zone.runOutsideAngular(() => {
if (omnibarConfig.experimental) {
// auth-client 2.0 made the "experimental" omnibar the default; maintain
// previous behavior until skyux-builder 2.0.
BBOmnibar.load(omnibarConfig);
} else {
BBOmnibarLegacy.load(omnibarConfig);
}
omnibarLoaded = true;
});
};
this.zone.runOutsideAngular(() => {
if (omnibarConfig.experimental) {
// auth-client 2.0 made the "experimental" omnibar the default; maintain
// previous behavior until skyux-builder 2.0.
BBOmnibar.load(omnibarConfig);
} else {
BBOmnibarLegacy.load(omnibarConfig);
}
omnibarLoaded = true;
});
};
public static processBootstrapConfig(): Promise {
if (SkyAppBootstrapper.config && SkyAppBootstrapper.config.auth) {
return BBAuth.getToken()
.then(() => {
const currentUrl = this.getUrl();
const params = new SkyAppRuntimeConfigParams(
currentUrl,
this.config.params!
);
const ensureContextArgs: BBContextArgs = {
envId: params.get('envid'),
envIdRequired: params.isRequired('envid'),
leId: params.get('leid'),
leIdRequired: params.isRequired('leid'),
svcId: params.get('svcid'),
svcIdRequired: params.isRequired('svcid'),
url: currentUrl
public getToken(args?: BBAuthGetTokenArgs): Promise {
return BBAuth.getToken(args);
}
public ngOnDestroy() {
if (omnibarLoaded) {
BBOmnibar.destroy();
omnibarLoaded = false;
}
}