dash-button-web 0.0.1 → 0.0.2
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/cjs/dash-button.cjs.entry.js +6 -3
- package/dist/cjs/dash-button.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/web-compnont.cjs.js +1 -1
- package/dist/collection/components/my-component/dash-button.js +24 -3
- package/dist/collection/components/my-component/dash-button.js.map +1 -1
- package/dist/components/dash-button.js +7 -3
- package/dist/components/dash-button.js.map +1 -1
- package/dist/esm/dash-button.entry.js +6 -3
- package/dist/esm/dash-button.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/web-compnont.js +1 -1
- package/dist/types/components/my-component/dash-button.d.ts +1 -0
- package/dist/types/components.d.ts +2 -0
- package/dist/web-compnont/{p-97a6df2d.entry.js → p-4356bec1.entry.js} +3 -3
- package/dist/web-compnont/p-4356bec1.entry.js.map +1 -0
- package/dist/web-compnont/web-compnont.esm.js +1 -1
- package/dist/web-compnont/web-compnont.esm.js.map +1 -1
- package/package.json +1 -1
- package/readme.md +10 -2
- package/dist/web-compnont/p-97a6df2d.entry.js.map +0 -1
|
@@ -2482,6 +2482,7 @@ const DashButtonComponent = class {
|
|
|
2482
2482
|
this.showPostLoginText = false;
|
|
2483
2483
|
this.silentCheckSso = false;
|
|
2484
2484
|
this.redirectUri = undefined;
|
|
2485
|
+
this.authMethod = "check-sso";
|
|
2485
2486
|
this.keycloakUri = "http://localhost:8080";
|
|
2486
2487
|
this.realm = "";
|
|
2487
2488
|
this.clientId = "";
|
|
@@ -2497,13 +2498,14 @@ const DashButtonComponent = class {
|
|
|
2497
2498
|
;
|
|
2498
2499
|
connectedCallback() {
|
|
2499
2500
|
this.keycloak.init({
|
|
2500
|
-
onLoad:
|
|
2501
|
+
onLoad: this.authMethod,
|
|
2501
2502
|
checkLoginIframe: false,
|
|
2502
2503
|
silentCheckSsoRedirectUri: this.silentCheckSso ? this.silentCheckSsoRedirectUri : '',
|
|
2503
2504
|
}).then(res => {
|
|
2504
2505
|
if (res) {
|
|
2505
2506
|
this.isAuth = true;
|
|
2506
2507
|
localStorage.setItem("keycloak", JSON.stringify(this.keycloak));
|
|
2508
|
+
document.cookie = "ZDZW_cookie=" + JSON.parse(localStorage.getItem('keycloak')).token;
|
|
2507
2509
|
this.givenName = JSON.parse(localStorage.getItem('keycloak')).idTokenParsed.given_name;
|
|
2508
2510
|
}
|
|
2509
2511
|
});
|
|
@@ -2513,6 +2515,7 @@ const DashButtonComponent = class {
|
|
|
2513
2515
|
}
|
|
2514
2516
|
logout() {
|
|
2515
2517
|
localStorage.removeItem("keycloak");
|
|
2518
|
+
document.cookie = "ZDZW_cookie=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
|
|
2516
2519
|
this.keycloak.logout();
|
|
2517
2520
|
}
|
|
2518
2521
|
showModal() {
|
|
@@ -2524,7 +2527,7 @@ const DashButtonComponent = class {
|
|
|
2524
2527
|
appModal.style.display = "none";
|
|
2525
2528
|
}
|
|
2526
2529
|
render() {
|
|
2527
|
-
return h("div", { key: '
|
|
2530
|
+
return h("div", { key: '46065686f61e27894acf13494d479f8e14ae440a' }, h("div", { key: 'fb795b6cab0e9a57ee9ddfc6a6ab69796de02d94' }, (() => {
|
|
2528
2531
|
if (this.isAuth && this.showPostLoginText) {
|
|
2529
2532
|
return (h("a", { href: this.redirectUri, id: "login-btn", class: "button button-link" }, h("span", { class: "button-text button-text-full-width" }, "Go to Dashboard")));
|
|
2530
2533
|
}
|
|
@@ -2534,7 +2537,7 @@ const DashButtonComponent = class {
|
|
|
2534
2537
|
else {
|
|
2535
2538
|
return (h("button", { onClick: this.login.bind(this), id: "login-btn", type: "button", class: "button" }, h("span", { class: "button-text" }, "Login")));
|
|
2536
2539
|
}
|
|
2537
|
-
})()), h("div", { key: '
|
|
2540
|
+
})()), h("div", { key: 'f64fc2082e07f576df4cff7d71453c8f18a4347e', id: "appListModal", class: "modal" }, h("div", { key: '9753fff951bd9719bb39db00cf99861dc1caeb2e', class: "modal-content" }, h("span", { key: 'f1a1ba93614473a498cf7f43d1ed1d2814a77df3', onClick: this.closeModal.bind(this), class: "close" }, "\u00D7"), h("h3", { key: '14a85f33052086fb9597a507789d145bec9cd076' }, "Applications"), h("div", { key: 'd323ba9ca8504ac36668c78c6c23c53dd695a6ac', class: "modal-app" }, "App 1"), h("div", { key: 'c1391a3b447aec37d81a723821ea28922a2cbaa4', class: "modal-app" }, "App 2"))));
|
|
2538
2541
|
}
|
|
2539
2542
|
get el() { return getElement(this); }
|
|
2540
2543
|
};
|