diff --git a/src/components/extension/renderer.tsx b/src/components/extension/renderer.tsx index f8d413d..4c45e9b 100644 --- a/src/components/extension/renderer.tsx +++ b/src/components/extension/renderer.tsx @@ -112,6 +112,14 @@ export default function ExtensionRenderer() { return } ) + + iframeElement.contentWindow.addEventListener( + "limanHashChange", + function (e: any) { + // Change the hash of the parent window with e.detail data + window.location.hash = e.detail + } + ) } const onHashChanged = () => { diff --git a/src/services/api.service.ts b/src/services/api.service.ts index 85e96af..3efc456 100644 --- a/src/services/api.service.ts +++ b/src/services/api.service.ts @@ -21,18 +21,13 @@ export class ApiService { return response }, (error) => { - if (error.response.status === 401) { + if (error.response && error.response.status === 401) { window.location.href = "/auth/login?redirect=" + window.location.pathname } - if (error.response.status === 504) { + if (error.response && error.response.status === 504) { window.location.href = "/504" } - /* - if (error.response.status === 403) { - window.location.href = "/403" - } - */ return Promise.reject(error) } )