@icvdeveloper/common-module 0.0.73 → 0.0.74
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/dist/module.json +1 -1
- package/dist/runtime/composables/useUcc.mjs +37 -32
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -1,40 +1,45 @@
|
|
|
1
1
|
import { get } from "lodash-es";
|
|
2
2
|
import { useApi } from "./useApi.mjs";
|
|
3
|
+
import { useTemplateConfigsStore } from "../store/templateConfigs.mjs";
|
|
3
4
|
export const useUcc = () => {
|
|
5
|
+
const { globalConfigValue } = useTemplateConfigsStore();
|
|
4
6
|
const loadUccScript = (eventId) => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
7
|
+
if (globalConfigValue("ucc_url")) {
|
|
8
|
+
window.uccMixin = {};
|
|
9
|
+
window.uccMixin.clientId = globalConfigValue("ucc_client_id");
|
|
10
|
+
window.uccMixin.eventId = eventId;
|
|
11
|
+
window.uccMixin.uccShowEventSignUp = uccShowEventSignUp;
|
|
12
|
+
let ucc = document.createElement("script");
|
|
13
|
+
ucc.setAttribute("src", globalConfigValue("ucc_url"));
|
|
14
|
+
ucc.onload = () => {
|
|
15
|
+
mmsWidgets.init({
|
|
16
|
+
clientId: window.uccMixin.clientId,
|
|
17
|
+
// Akamai client id
|
|
18
|
+
origin: "NEJMGroupEvents",
|
|
19
|
+
debug: true,
|
|
20
|
+
// set this false for production
|
|
21
|
+
onReady: function() {
|
|
22
|
+
console.log("UCC ready");
|
|
23
|
+
},
|
|
24
|
+
onLoginSuccess: function(ssoEvent) {
|
|
25
|
+
console.log("UCC login success");
|
|
26
|
+
},
|
|
27
|
+
onAuthStateReady: function(ssoEvent) {
|
|
28
|
+
console.log("UCC auth state ready");
|
|
29
|
+
if (window.uccMixin.eventId) {
|
|
30
|
+
window.uccMixin.uccShowEventSignUp(window.uccMixin.eventId);
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
onRegistrationSuccess: function(ssoEvent) {
|
|
34
|
+
console.log("UCC reg success");
|
|
35
|
+
},
|
|
36
|
+
onLogoutSuccess: function(ssoEvent) {
|
|
37
|
+
console.log("UCC logout success");
|
|
27
38
|
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
onLogoutSuccess: function(ssoEvent) {
|
|
33
|
-
console.log("UCC logout success");
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
document.head.appendChild(ucc);
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
document.head.appendChild(ucc);
|
|
42
|
+
}
|
|
38
43
|
};
|
|
39
44
|
const uccShowEventSignUp = (eventId) => {
|
|
40
45
|
return new Promise((resolve, reject) => {
|