@woodsportal/hubspot-kit 1.0.42-dev.1 → 1.0.42-dev.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@woodsportal/hubspot-kit",
|
|
3
|
-
"version": "1.0.42-dev.
|
|
3
|
+
"version": "1.0.42-dev.2",
|
|
4
4
|
"description": "WoodsCLI — HubSpot CMS dev kit by WoodsPortal. wp CLI, Vite presets, module-config overlay, and theme/module build pipelines.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -2,7 +2,7 @@ import { useEffect, useRef, useState } from 'react'
|
|
|
2
2
|
import { RouterProvider } from '@tanstack/react-router'
|
|
3
3
|
import { installCrossTabSessionListener } from 'woodsportal-client-sdk'
|
|
4
4
|
|
|
5
|
-
import { api } from '@/integrations/woodsportal-sdk'
|
|
5
|
+
import { api, isSessionRefreshDeferredError } from '@/integrations/woodsportal-sdk'
|
|
6
6
|
import * as TanStackQueryProvider from '@/integrations/tanstack-query/root-provider'
|
|
7
7
|
import { env } from '@/env'
|
|
8
8
|
import Loader from '@/components/ui/loader/loader'
|
|
@@ -123,7 +123,10 @@ export function App({ router }: AppProps) {
|
|
|
123
123
|
|
|
124
124
|
try {
|
|
125
125
|
await session.refreshSession({ force: true })
|
|
126
|
-
} catch {
|
|
126
|
+
} catch (error) {
|
|
127
|
+
if (isSessionRefreshDeferredError(error)) {
|
|
128
|
+
return
|
|
129
|
+
}
|
|
127
130
|
if (!inCmsEditor) {
|
|
128
131
|
await teardownAndRedirectToLogin()
|
|
129
132
|
}
|
|
@@ -147,7 +150,9 @@ export function App({ router }: AppProps) {
|
|
|
147
150
|
}),
|
|
148
151
|
])
|
|
149
152
|
} catch (error) {
|
|
150
|
-
if (
|
|
153
|
+
if (isSessionRefreshDeferredError(error)) {
|
|
154
|
+
// API temporarily unavailable — keep session cookies intact.
|
|
155
|
+
} else if (!inCmsEditor && skipCurrentPublicPath()) {
|
|
151
156
|
await teardownAndRedirectToLogin()
|
|
152
157
|
} else if (error instanceof Error && error.message !== 'bootstrap_timeout') {
|
|
153
158
|
throw error
|