This is an automated email from the ASF dual-hosted git repository.

marat pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-karavan.git


The following commit(s) were added to refs/heads/main by this push:
     new c08f3ff5 SSO deps update
c08f3ff5 is described below

commit c08f3ff551e7e985231d29be12c1db7855112251
Author: Marat Gubaidullin <ma...@talismancloud.io>
AuthorDate: Mon Jan 27 15:01:03 2025 -0500

    SSO deps update
---
 karavan-app/src/main/webui/package-lock.json  | 29 ++++++++++++++++++++++-----
 karavan-app/src/main/webui/package.json       |  2 +-
 karavan-app/src/main/webui/src/api/SsoApi.tsx |  8 ++++----
 3 files changed, 29 insertions(+), 10 deletions(-)

diff --git a/karavan-app/src/main/webui/package-lock.json 
b/karavan-app/src/main/webui/package-lock.json
index ad4c89e1..404ae1b7 100644
--- a/karavan-app/src/main/webui/package-lock.json
+++ b/karavan-app/src/main/webui/package-lock.json
@@ -24,7 +24,7 @@
         "file-saver": "2.0.5",
         "html-to-image": "1.11.11",
         "karavan-core": "file:../../../../karavan-core",
-        "keycloak-js": "26.1.0",
+        "keycloak-js": "25.0.6",
         "react": "18.3.1",
         "react-dom": "18.3.1",
         "react-hook-form": "^7.54.2",
@@ -4645,6 +4645,12 @@
       "dev": true,
       "license": "ISC"
     },
+    "node_modules/js-sha256": {
+      "version": "0.11.0",
+      "resolved": 
"https://registry.npmjs.org/js-sha256/-/js-sha256-0.11.0.tgz";,
+      "integrity": 
"sha512-6xNlKayMZvds9h1Y1VWc0fQHQ82BxTXizWPEtEeGvmOUYpBRy4gbWroHLpzowe6xiQhHpelCQiE7HEdznyBL9Q==",
+      "license": "MIT"
+    },
     "node_modules/js-tokens": {
       "version": "4.0.0",
       "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz";,
@@ -4724,15 +4730,28 @@
         "node": ">=6"
       }
     },
+    "node_modules/jwt-decode": {
+      "version": "4.0.0",
+      "resolved": 
"https://registry.npmjs.org/jwt-decode/-/jwt-decode-4.0.0.tgz";,
+      "integrity": 
"sha512-+KJGIyHgkGuIq3IEBNftfhW/LfWhXUIY6OmyVWjliu5KH1y0fw7VQ8YndE2O4qZdMSd9SqbnC8GOcZEy0Om7sA==",
+      "license": "MIT",
+      "engines": {
+        "node": ">=18"
+      }
+    },
     "node_modules/karavan-core": {
       "resolved": "../../../../karavan-core",
       "link": true
     },
     "node_modules/keycloak-js": {
-      "version": "26.1.0",
-      "resolved": 
"https://registry.npmjs.org/keycloak-js/-/keycloak-js-26.1.0.tgz";,
-      "integrity": 
"sha512-3CTelLNADK6sIxGHCQmKlT3ezcIp8O3Iimmg+ybS78RHy+HAUkkoBaW/YuHGdYkfEDMBlrqD3u+CQ4vLsrmyFA==",
-      "license": "Apache-2.0"
+      "version": "25.0.6",
+      "resolved": 
"https://registry.npmjs.org/keycloak-js/-/keycloak-js-25.0.6.tgz";,
+      "integrity": 
"sha512-Km+dc+XfNvY6a4az5jcxTK0zPk52ns9mAxLrHj7lF3V+riVYvQujfHmhayltJDjEpSOJ4C8a57LFNNKnNnRP2g==",
+      "license": "Apache-2.0",
+      "dependencies": {
+        "js-sha256": "^0.11.0",
+        "jwt-decode": "^4.0.0"
+      }
     },
     "node_modules/keyv": {
       "version": "4.5.4",
diff --git a/karavan-app/src/main/webui/package.json 
b/karavan-app/src/main/webui/package.json
index 6b0e3091..3d2890e3 100644
--- a/karavan-app/src/main/webui/package.json
+++ b/karavan-app/src/main/webui/package.json
@@ -48,7 +48,7 @@
     "file-saver": "2.0.5",
     "html-to-image": "1.11.11",
     "karavan-core": "file:../../../../karavan-core",
-    "keycloak-js": "26.1.0",
+    "keycloak-js": "25.0.6",
     "react": "18.3.1",
     "react-dom": "18.3.1",
     "react-hook-form": "^7.54.2",
diff --git a/karavan-app/src/main/webui/src/api/SsoApi.tsx 
b/karavan-app/src/main/webui/src/api/SsoApi.tsx
index 6bf480c5..af3cf301 100644
--- a/karavan-app/src/main/webui/src/api/SsoApi.tsx
+++ b/karavan-app/src/main/webui/src/api/SsoApi.tsx
@@ -26,10 +26,10 @@ export class SsoApi {
     static auth(after: () => void) {
         KaravanApi.getConfig((config: any) => {
             SsoApi.keycloak = new Keycloak({url: config.url, realm: 
config.realm, clientId: config.clientId});
-            SsoApi.keycloak.init({onLoad: 'login-required', flow: 'hybrid', 
checkLoginIframe: false}).then(value => {
+            SsoApi.keycloak.init({onLoad: 'login-required', flow: 'hybrid', 
checkLoginIframe: false}).then((value: any) => {
                 console.log('SsoApi', 'User is now authenticated.');
                 after();
-            }).catch(reason => {
+            }).catch((reason: any) => {
                 console.log('SsoApi', 'Error:', reason);
                 window.location.reload();
             });
@@ -38,11 +38,11 @@ export class SsoApi {
 
     static logout(after: () => void) {
         if (SsoApi.keycloak) {
-            SsoApi.keycloak.logout().then(value => {
+            SsoApi.keycloak.logout().then((value: any) => {
                 console.log('SsoApi', 'User is now logout.');
                 useAppConfigStore.setState({isAuthorized: false})
                 window.location.reload();
-            }).catch(reason => {
+            }).catch((reason: any) => {
                 console.log('SsoApi', 'Error:', reason);
                 window.location.reload();
             });

Reply via email to