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
|
@@ -2486,6 +2486,7 @@ const DashButtonComponent = class {
|
|
|
2486
2486
|
this.showPostLoginText = false;
|
|
2487
2487
|
this.silentCheckSso = false;
|
|
2488
2488
|
this.redirectUri = undefined;
|
|
2489
|
+
this.authMethod = "check-sso";
|
|
2489
2490
|
this.keycloakUri = "http://localhost:8080";
|
|
2490
2491
|
this.realm = "";
|
|
2491
2492
|
this.clientId = "";
|
|
@@ -2501,13 +2502,14 @@ const DashButtonComponent = class {
|
|
|
2501
2502
|
;
|
|
2502
2503
|
connectedCallback() {
|
|
2503
2504
|
this.keycloak.init({
|
|
2504
|
-
onLoad:
|
|
2505
|
+
onLoad: this.authMethod,
|
|
2505
2506
|
checkLoginIframe: false,
|
|
2506
2507
|
silentCheckSsoRedirectUri: this.silentCheckSso ? this.silentCheckSsoRedirectUri : '',
|
|
2507
2508
|
}).then(res => {
|
|
2508
2509
|
if (res) {
|
|
2509
2510
|
this.isAuth = true;
|
|
2510
2511
|
localStorage.setItem("keycloak", JSON.stringify(this.keycloak));
|
|
2512
|
+
document.cookie = "ZDZW_cookie=" + JSON.parse(localStorage.getItem('keycloak')).token;
|
|
2511
2513
|
this.givenName = JSON.parse(localStorage.getItem('keycloak')).idTokenParsed.given_name;
|
|
2512
2514
|
}
|
|
2513
2515
|
});
|
|
@@ -2517,6 +2519,7 @@ const DashButtonComponent = class {
|
|
|
2517
2519
|
}
|
|
2518
2520
|
logout() {
|
|
2519
2521
|
localStorage.removeItem("keycloak");
|
|
2522
|
+
document.cookie = "ZDZW_cookie=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
|
|
2520
2523
|
this.keycloak.logout();
|
|
2521
2524
|
}
|
|
2522
2525
|
showModal() {
|
|
@@ -2528,7 +2531,7 @@ const DashButtonComponent = class {
|
|
|
2528
2531
|
appModal.style.display = "none";
|
|
2529
2532
|
}
|
|
2530
2533
|
render() {
|
|
2531
|
-
return index.h("div", { key: '
|
|
2534
|
+
return index.h("div", { key: '46065686f61e27894acf13494d479f8e14ae440a' }, index.h("div", { key: 'fb795b6cab0e9a57ee9ddfc6a6ab69796de02d94' }, (() => {
|
|
2532
2535
|
if (this.isAuth && this.showPostLoginText) {
|
|
2533
2536
|
return (index.h("a", { href: this.redirectUri, id: "login-btn", class: "button button-link" }, index.h("span", { class: "button-text button-text-full-width" }, "Go to Dashboard")));
|
|
2534
2537
|
}
|
|
@@ -2538,7 +2541,7 @@ const DashButtonComponent = class {
|
|
|
2538
2541
|
else {
|
|
2539
2542
|
return (index.h("button", { onClick: this.login.bind(this), id: "login-btn", type: "button", class: "button" }, index.h("span", { class: "button-text" }, "Login")));
|
|
2540
2543
|
}
|
|
2541
|
-
})()), index.h("div", { key: '
|
|
2544
|
+
})()), index.h("div", { key: 'f64fc2082e07f576df4cff7d71453c8f18a4347e', id: "appListModal", class: "modal" }, index.h("div", { key: '9753fff951bd9719bb39db00cf99861dc1caeb2e', class: "modal-content" }, index.h("span", { key: 'f1a1ba93614473a498cf7f43d1ed1d2814a77df3', onClick: this.closeModal.bind(this), class: "close" }, "\u00D7"), index.h("h3", { key: '14a85f33052086fb9597a507789d145bec9cd076' }, "Applications"), index.h("div", { key: 'd323ba9ca8504ac36668c78c6c23c53dd695a6ac', class: "modal-app" }, "App 1"), index.h("div", { key: 'c1391a3b447aec37d81a723821ea28922a2cbaa4', class: "modal-app" }, "App 2"))));
|
|
2542
2545
|
}
|
|
2543
2546
|
get el() { return index.getElement(this); }
|
|
2544
2547
|
};
|