Files
config-pacs-docker/nv/html/nv-nopdf/styles/packages/mxab_keycloak-loader.js
2025-02-26 14:49:25 +07:00

91 lines
3.1 KiB
JavaScript

//////////////////////////////////////////////////////////////////////////
// //
// This is a generated file. You can view the original //
// source in your browser if your browser supports source maps. //
// Source maps are supported by all recent versions of Chrome, Safari, //
// and Firefox, and by Internet Explorer 11. //
// //
//////////////////////////////////////////////////////////////////////////
(function () {
/* Imports */
var Meteor = Package.meteor.Meteor;
var global = Package.meteor.global;
var meteorEnv = Package.meteor.meteorEnv;
var ServiceConfiguration = Package['service-configuration'].ServiceConfiguration;
var MeteorKeycloak = Package['mxab:keycloak-oauth'].MeteorKeycloak;
var meteorInstall = Package.modules.meteorInstall;
var meteorBabelHelpers = Package['babel-runtime'].meteorBabelHelpers;
var Promise = Package.promise.Promise;
var Accounts = Package['accounts-base'].Accounts;
var Symbol = Package['ecmascript-runtime-client'].Symbol;
var Map = Package['ecmascript-runtime-client'].Map;
var Set = Package['ecmascript-runtime-client'].Set;
var require = meteorInstall({"node_modules":{"meteor":{"mxab:keycloak-loader":{"keycloak-loader.js":function(require,exports,module){
///////////////////////////////////////////////////////////////////////
// //
// packages/mxab_keycloak-loader/keycloak-loader.js //
// //
///////////////////////////////////////////////////////////////////////
//
var Tracker;
module.watch(require("meteor/tracker"), {
Tracker: function (v) {
Tracker = v;
}
}, 0);
var loader = new Promise(function (resolve, reject) {
Tracker.autorun(function (c) {
if (Accounts.loginServicesConfigured()) {
c.stop();
start();
}
});
function start() {
var config = ServiceConfiguration.configurations.findOne({
service: 'keycloak'
});
if (!config || !config["auth-server-url"]) {
throw new ServiceConfiguration.ConfigError();
}
var authServerUrl = config["auth-server-url"];
var script = document.createElement('script');
script.onload = function () {
MeteorKeycloak.Keycloak = window.Keycloak;
var kc = {};
kc.authServerUrl = config['auth-server-url'];
kc.realm = config['realm'];
kc.clientId = config['resource'];
kc.clientSecret = (config['credentials'] || {})['secret'];
resolve(new window.Keycloak(kc));
};
script.onerror = reject;
script.src = authServerUrl + "/js/keycloak.min.js";
document.head.appendChild(script);
}
});
MeteorKeycloak.loader = loader;
///////////////////////////////////////////////////////////////////////
}}}}},{
"extensions": [
".js",
".json"
]
});
require("/node_modules/meteor/mxab:keycloak-loader/keycloak-loader.js");
/* Exports */
Package._define("mxab:keycloak-loader");
})();