From cf8c48caeb1ed28e98625e9ede7b9a59ec4b7895 Mon Sep 17 00:00:00 2001 From: Sone Gillis Date: Mon, 20 Jul 2026 21:28:11 +0100 Subject: [PATCH] fix(tenant-switch): complete auth handoff and pull in SDK loader-hang fix Bumps @iblai/iblai-js to 1.26.3, which carries the web-utils AuthProvider fix that recovers the loading screen when a tenant switch lands back on the app before the switch lock expires (previously hung indefinitely). App-side handoff fixes: - Parse the SSO handoff payload in the iframe defaultHandler: it can arrive as a JSON string (cross-origin postMessage) rather than an object, so axd_token was never detected and the session wasn't saved. - redirectToMentor now preserves the current query string on every path, not only on "/", so params survive the post-switch redirect into the mentor. --- package.json | 2 +- pnpm-lock.yaml | 44 ++++++++++++++++++++++---------------------- providers/index.tsx | 10 ++++++---- 3 files changed, 29 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index 74048fcf..de556ede 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "dependencies": { "@iblai/agent-ai": "2.5.2", "@iblai/iblai-api": "4.166.0-ai", - "@iblai/iblai-js": "1.25.1", + "@iblai/iblai-js": "1.26.3", "@iblai/iblai-web-mentor": "1.3.4", "@livekit/components-react": "2.8.1", "@livekit/components-styles": "1.1.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c2d70507..0534a4e6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -44,8 +44,8 @@ importers: specifier: 4.166.0-ai version: 4.166.0-ai '@iblai/iblai-js': - specifier: 1.25.1 - version: 1.25.1(09ad73cc8de68f3b29da137077ebeb71) + specifier: 1.26.3 + version: 1.26.3(09ad73cc8de68f3b29da137077ebeb71) '@iblai/iblai-web-mentor': specifier: 1.3.4 version: 1.3.4(@babel/core@7.29.7)(@types/babel__core@7.20.5)(rollup@4.62.2)(typescript@5.9.3) @@ -857,8 +857,8 @@ packages: react: 19.1.0 react-dom: 19.1.0 - '@iblai/data-layer@1.9.2': - resolution: {integrity: sha512-z7XNYNb+XoahIhzld9yBVqAnf/WfpUddCAi/5QmJeP6FkYecm/GRKsPx4RwIB9vw2Uk64iJxn1DCcfEc1p3A+g==} + '@iblai/data-layer@1.9.3': + resolution: {integrity: sha512-NTd9QsA56gjgQRhJTq8a1f6DhdvJdO/FL6w2e0HFYboQ9p7pu9bI5tqUZiuuxSL3o52f7wkBDfbjaqOu6zyZEA==} engines: {node: 25.3.0} peerDependencies: '@reduxjs/toolkit': 2.7.0 @@ -869,8 +869,8 @@ packages: '@iblai/iblai-api@4.166.0-ai': resolution: {integrity: sha512-dY9Jv+CkXEyTxRsOQFay5YvYe8K2LSQluJJvtssGQV2RbrxPPzONaKfnhcyarDs7Ft35Xqk1fuErjhUwNG3OIg==} - '@iblai/iblai-js@1.25.1': - resolution: {integrity: sha512-7CPx9gpxQ057xVPXgCh4MX8goaa6AWeugVIKObi8DSEwDaawByCs7Pi02Ubymzd4R5Z74DeW1iibPjEwe0csMQ==} + '@iblai/iblai-js@1.26.3': + resolution: {integrity: sha512-uFw7rArs/ahoxc4//r+NFkz2v5jfrykzIqatuN0oJoog/OlnRE+iTSK+hvSzR3RdMTEEOgItCizNb/1dG7VWCw==} engines: {node: '>=20.0.0'} hasBin: true peerDependencies: @@ -899,13 +899,13 @@ packages: engines: {node: '>=20.0.0'} hasBin: true - '@iblai/web-containers@1.14.0': - resolution: {integrity: sha512-RqtcQHHgT4hR3jnj+E5LVXmgQWkatV2fP3Wbgf7u2+sdaXP5KBFNVnWIIdB2cLhRHCrvp/RbS9BBeplU14Nv9g==} + '@iblai/web-containers@1.15.1': + resolution: {integrity: sha512-eu4OgOaW3jbmVMQ3IA+G7hUNdns1ZabovsumQYHWFTPfo56UOB2TNo9Jl38L7uAWzeCoR2pBUVXv4gkpuMoE6g==} engines: {node: 25.3.0} peerDependencies: - '@iblai/data-layer': 1.9.2 + '@iblai/data-layer': 1.9.3 '@iblai/iblai-api': 4.166.0-ai - '@iblai/web-utils': 1.11.12 + '@iblai/web-utils': 1.13.0 '@livekit/components-react': 2.8.1 '@radix-ui/react-dialog': ^1.1.7 '@reduxjs/toolkit': 2.7.0 @@ -925,8 +925,8 @@ packages: sonner: optional: true - '@iblai/web-utils@1.12.0': - resolution: {integrity: sha512-qXJZgSt3DgbUx9jhujsYOx/Vpn52RgaRr8RYd9hOYHkTfBZNjznHylvqY3xYBprGTuCLyVBnzyHbVnBi4Yez+A==} + '@iblai/web-utils@1.13.2': + resolution: {integrity: sha512-k9SfOIzTnOGdvjTwIduaeVVCilYLwsvsU7Gd0RxPoZJZPYVJXw31Pl4irPuGZS+pFYwARbI9LzafMKnnIwIOkA==} engines: {node: 25.3.0} peerDependencies: '@iblai/data-layer': ^1.1.2 @@ -9916,7 +9916,7 @@ snapshots: react: 19.1.0 react-dom: 19.1.0(react@19.1.0) - '@iblai/data-layer@1.9.2(@reduxjs/toolkit@2.7.0(react-redux@9.2.0(@types/react@19.1.17)(react@19.1.0)(redux@5.0.1))(react@19.1.0))(react-dom@19.1.0(react@19.1.0))(react-redux@9.2.0(@types/react@19.1.17)(react@19.1.0)(redux@5.0.1))(react@19.1.0)': + '@iblai/data-layer@1.9.3(@reduxjs/toolkit@2.7.0(react-redux@9.2.0(@types/react@19.1.17)(react@19.1.0)(redux@5.0.1))(react@19.1.0))(react-dom@19.1.0(react@19.1.0))(react-redux@9.2.0(@types/react@19.1.17)(react@19.1.0)(redux@5.0.1))(react@19.1.0)': dependencies: '@iblai/iblai-api': 4.166.0-ai '@reduxjs/toolkit': 2.7.0(react-redux@9.2.0(@types/react@19.1.17)(react@19.1.0)(redux@5.0.1))(react@19.1.0) @@ -9930,13 +9930,13 @@ snapshots: dependencies: tslib: 2.8.1 - '@iblai/iblai-js@1.25.1(09ad73cc8de68f3b29da137077ebeb71)': + '@iblai/iblai-js@1.26.3(09ad73cc8de68f3b29da137077ebeb71)': dependencies: - '@iblai/data-layer': 1.9.2(@reduxjs/toolkit@2.7.0(react-redux@9.2.0(@types/react@19.1.17)(react@19.1.0)(redux@5.0.1))(react@19.1.0))(react-dom@19.1.0(react@19.1.0))(react-redux@9.2.0(@types/react@19.1.17)(react@19.1.0)(redux@5.0.1))(react@19.1.0) + '@iblai/data-layer': 1.9.3(@reduxjs/toolkit@2.7.0(react-redux@9.2.0(@types/react@19.1.17)(react@19.1.0)(redux@5.0.1))(react@19.1.0))(react-dom@19.1.0(react@19.1.0))(react-redux@9.2.0(@types/react@19.1.17)(react@19.1.0)(redux@5.0.1))(react@19.1.0) '@iblai/iblai-api': 4.166.0-ai '@iblai/mcp': 1.8.0 - '@iblai/web-containers': 1.14.0(a376d4385c5552c3b69558293701dc09) - '@iblai/web-utils': 1.12.0(@iblai/data-layer@1.9.2(@reduxjs/toolkit@2.7.0(react-redux@9.2.0(@types/react@19.1.17)(react@19.1.0)(redux@5.0.1))(react@19.1.0))(react-dom@19.1.0(react@19.1.0))(react-redux@9.2.0(@types/react@19.1.17)(react@19.1.0)(redux@5.0.1))(react@19.1.0))(@iblai/iblai-api@4.166.0-ai)(@tauri-apps/api@2.11.0)(@tauri-apps/plugin-os@2.3.2)(@types/react@19.1.17)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(redux@5.0.1)(sonner@2.0.7(react-dom@19.1.0(react@19.1.0))(react@19.1.0)) + '@iblai/web-containers': 1.15.1(d6cf1406a6a410662f14b27f46a838db) + '@iblai/web-utils': 1.13.2(@iblai/data-layer@1.9.3(@reduxjs/toolkit@2.7.0(react-redux@9.2.0(@types/react@19.1.17)(react@19.1.0)(redux@5.0.1))(react@19.1.0))(react-dom@19.1.0(react@19.1.0))(react-redux@9.2.0(@types/react@19.1.17)(react@19.1.0)(redux@5.0.1))(react@19.1.0))(@iblai/iblai-api@4.166.0-ai)(@tauri-apps/api@2.11.0)(@tauri-apps/plugin-os@2.3.2)(@types/react@19.1.17)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(redux@5.0.1)(sonner@2.0.7(react-dom@19.1.0(react@19.1.0))(react@19.1.0)) '@radix-ui/react-dialog': 1.1.7(@types/react-dom@19.2.1(@types/react@19.1.17))(@types/react@19.1.17)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) '@reduxjs/toolkit': 2.7.0(react-redux@9.2.0(@types/react@19.1.17)(react@19.1.0)(redux@5.0.1))(react@19.1.0) axios: 1.18.1 @@ -9985,11 +9985,11 @@ snapshots: - '@cfworker/json-schema' - supports-color - '@iblai/web-containers@1.14.0(a376d4385c5552c3b69558293701dc09)': + '@iblai/web-containers@1.15.1(d6cf1406a6a410662f14b27f46a838db)': dependencies: - '@iblai/data-layer': 1.9.2(@reduxjs/toolkit@2.7.0(react-redux@9.2.0(@types/react@19.1.17)(react@19.1.0)(redux@5.0.1))(react@19.1.0))(react-dom@19.1.0(react@19.1.0))(react-redux@9.2.0(@types/react@19.1.17)(react@19.1.0)(redux@5.0.1))(react@19.1.0) + '@iblai/data-layer': 1.9.3(@reduxjs/toolkit@2.7.0(react-redux@9.2.0(@types/react@19.1.17)(react@19.1.0)(redux@5.0.1))(react@19.1.0))(react-dom@19.1.0(react@19.1.0))(react-redux@9.2.0(@types/react@19.1.17)(react@19.1.0)(redux@5.0.1))(react@19.1.0) '@iblai/iblai-api': 4.166.0-ai - '@iblai/web-utils': 1.12.0(@iblai/data-layer@1.9.2(@reduxjs/toolkit@2.7.0(react-redux@9.2.0(@types/react@19.1.17)(react@19.1.0)(redux@5.0.1))(react@19.1.0))(react-dom@19.1.0(react@19.1.0))(react-redux@9.2.0(@types/react@19.1.17)(react@19.1.0)(redux@5.0.1))(react@19.1.0))(@iblai/iblai-api@4.166.0-ai)(@tauri-apps/api@2.11.0)(@tauri-apps/plugin-os@2.3.2)(@types/react@19.1.17)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(redux@5.0.1)(sonner@2.0.7(react-dom@19.1.0(react@19.1.0))(react@19.1.0)) + '@iblai/web-utils': 1.13.2(@iblai/data-layer@1.9.3(@reduxjs/toolkit@2.7.0(react-redux@9.2.0(@types/react@19.1.17)(react@19.1.0)(redux@5.0.1))(react@19.1.0))(react-dom@19.1.0(react@19.1.0))(react-redux@9.2.0(@types/react@19.1.17)(react@19.1.0)(redux@5.0.1))(react@19.1.0))(@iblai/iblai-api@4.166.0-ai)(@tauri-apps/api@2.11.0)(@tauri-apps/plugin-os@2.3.2)(@types/react@19.1.17)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(redux@5.0.1)(sonner@2.0.7(react-dom@19.1.0(react@19.1.0))(react@19.1.0)) '@radix-ui/react-accordion': 1.2.8(@types/react-dom@19.2.1(@types/react@19.1.17))(@types/react@19.1.17)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) '@radix-ui/react-avatar': 1.1.7(@types/react-dom@19.2.1(@types/react@19.1.17))(@types/react@19.1.17)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) '@radix-ui/react-checkbox': 1.2.3(@types/react-dom@19.2.1(@types/react@19.1.17))(@types/react@19.1.17)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) @@ -10073,9 +10073,9 @@ snapshots: - supports-color - vinxi - '@iblai/web-utils@1.12.0(@iblai/data-layer@1.9.2(@reduxjs/toolkit@2.7.0(react-redux@9.2.0(@types/react@19.1.17)(react@19.1.0)(redux@5.0.1))(react@19.1.0))(react-dom@19.1.0(react@19.1.0))(react-redux@9.2.0(@types/react@19.1.17)(react@19.1.0)(redux@5.0.1))(react@19.1.0))(@iblai/iblai-api@4.166.0-ai)(@tauri-apps/api@2.11.0)(@tauri-apps/plugin-os@2.3.2)(@types/react@19.1.17)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(redux@5.0.1)(sonner@2.0.7(react-dom@19.1.0(react@19.1.0))(react@19.1.0))': + '@iblai/web-utils@1.13.2(@iblai/data-layer@1.9.3(@reduxjs/toolkit@2.7.0(react-redux@9.2.0(@types/react@19.1.17)(react@19.1.0)(redux@5.0.1))(react@19.1.0))(react-dom@19.1.0(react@19.1.0))(react-redux@9.2.0(@types/react@19.1.17)(react@19.1.0)(redux@5.0.1))(react@19.1.0))(@iblai/iblai-api@4.166.0-ai)(@tauri-apps/api@2.11.0)(@tauri-apps/plugin-os@2.3.2)(@types/react@19.1.17)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(redux@5.0.1)(sonner@2.0.7(react-dom@19.1.0(react@19.1.0))(react@19.1.0))': dependencies: - '@iblai/data-layer': 1.9.2(@reduxjs/toolkit@2.7.0(react-redux@9.2.0(@types/react@19.1.17)(react@19.1.0)(redux@5.0.1))(react@19.1.0))(react-dom@19.1.0(react@19.1.0))(react-redux@9.2.0(@types/react@19.1.17)(react@19.1.0)(redux@5.0.1))(react@19.1.0) + '@iblai/data-layer': 1.9.3(@reduxjs/toolkit@2.7.0(react-redux@9.2.0(@types/react@19.1.17)(react@19.1.0)(redux@5.0.1))(react@19.1.0))(react-dom@19.1.0(react@19.1.0))(react-redux@9.2.0(@types/react@19.1.17)(react@19.1.0)(redux@5.0.1))(react@19.1.0) '@iblai/iblai-api': 4.166.0-ai '@reduxjs/toolkit': 2.11.2(react-redux@9.2.0(@types/react@19.1.17)(react@19.1.0)(redux@5.0.1))(react@19.1.0) axios: 1.18.1 diff --git a/providers/index.tsx b/providers/index.tsx index ab911af6..4a7ce680 100644 --- a/providers/index.tsx +++ b/providers/index.tsx @@ -106,6 +106,11 @@ export default function Providers({ children }: { children: React.ReactNode }) { useIframeMessageHandler({ handlers, defaultHandler: (data) => { + // The SSO handoff payload can arrive as a JSON string (cross-origin + // postMessage) or an already-parsed object — normalize before reading. + try { + data = JSON.parse(data); + } catch {} if (data.axd_token) { saveUserObjectToLocalStorage(data); window.location.reload(); @@ -277,10 +282,7 @@ export default function Providers({ children }: { children: React.ReactNode }) { } function redirectToMentor(tenantKey: string, mentorId: string) { - let queryParams = ''; - if (window.location.pathname === '/') { - queryParams = window.location.search; - } + const queryParams = window.location.search; router.push(`/platform/${tenantKey}/${mentorId}${queryParams}`); }