From a774481c2db6886d0257c6a86320dd66661aa3aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Tue, 31 Oct 2023 08:36:13 +0100 Subject: [PATCH] Development server - handle also the manifests.js file request Proxy the request to the real Cockpit server, but patch the response with the latest Agama manifest from the current sources --- web/src/DevServerWrapper.jsx | 5 ++- web/src/lib/webpack-manifests-handler.js | 48 ++++++++++++++++++++++++ web/webpack.config.js | 15 +++++++- 3 files changed, 64 insertions(+), 4 deletions(-) create mode 100644 web/src/lib/webpack-manifests-handler.js diff --git a/web/src/DevServerWrapper.jsx b/web/src/DevServerWrapper.jsx index c2397bdde8..f4268f5fec 100644 --- a/web/src/DevServerWrapper.jsx +++ b/web/src/DevServerWrapper.jsx @@ -116,8 +116,9 @@ export default function DevServerWrapper({ children }) { // handle updating the iframe with the login form const onFrameLoad = () => { const passwordInput = iframeRef.current.contentWindow.document.getElementById(loginId); - // if there is no password field displayed then the user has authenticated successfully - if (!passwordInput) setIsAuthenticated(true); + // reload the window so the manifests.js file referenced from the + // index.html file is also loaded again + if (!passwordInput) window.location.reload(); }; return