@equinor/roma-framework 0.0.8 → 0.0.9
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/dev-portal/package.json
CHANGED
|
@@ -60123,17 +60123,30 @@ var __privateMethod = (obj, member, method) => {
|
|
|
60123
60123
|
}
|
|
60124
60124
|
}
|
|
60125
60125
|
const configure = async (config2) => {
|
|
60126
|
+
var _a3;
|
|
60127
|
+
const request = await fetch("/_discovery/environments/current");
|
|
60128
|
+
const environment = await request.json();
|
|
60129
|
+
const portalService = (_a3 = environment.services) == null ? void 0 : _a3.find((v2) => v2.key === "portal");
|
|
60130
|
+
if (!portalService || !environment.frontendClientId) {
|
|
60131
|
+
const error = [];
|
|
60132
|
+
if (!portalService)
|
|
60133
|
+
error.push(`Missing service: "portal"`);
|
|
60134
|
+
if (!environment.frontendClientId)
|
|
60135
|
+
error.push(`Missing frontend clientId`);
|
|
60136
|
+
throw new Error(`Missing environment information:
|
|
60137
|
+
${error.join("\n")}`);
|
|
60138
|
+
}
|
|
60126
60139
|
config2.logger.level = 2;
|
|
60127
60140
|
config2.configureServiceDiscovery({
|
|
60128
60141
|
client: {
|
|
60129
60142
|
baseUri: typeof document === "undefined" && typeof location === "undefined" ? require("url").pathToFileURL(__filename).href : typeof document === "undefined" ? location.href : _documentCurrentScript && _documentCurrentScript.src || new URL("roma-framework.umd.js", document.baseURI).href,
|
|
60130
|
-
defaultScopes:
|
|
60143
|
+
defaultScopes: portalService.defaultScopes
|
|
60131
60144
|
}
|
|
60132
60145
|
});
|
|
60133
60146
|
config2.configureMsal(
|
|
60134
60147
|
{
|
|
60135
60148
|
tenantId: "3aa4a235-b6e2-48d5-9195-7fcf05b459b0",
|
|
60136
|
-
clientId:
|
|
60149
|
+
clientId: environment.frontendClientId,
|
|
60137
60150
|
redirectUri: "/authentication/login-callback"
|
|
60138
60151
|
},
|
|
60139
60152
|
{ requiresAuth: true }
|