From 15528f774472703362e0a16c9b83bf7b7364fe01 Mon Sep 17 00:00:00 2001 From: kshern Date: Mon, 17 Feb 2025 10:44:08 +0800 Subject: [PATCH] fix: move OAuth callback logic to outer AppWrapper component --- client/src/App.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/src/App.tsx b/client/src/App.tsx index 246e035f4..f3d9f98fb 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -49,7 +49,7 @@ const params = new URLSearchParams(window.location.search); const PROXY_PORT = params.get("proxyPort") ?? "3000"; const PROXY_SERVER_URL = `http://localhost:${PROXY_PORT}`; -const App = () => { +const AppWrapper = () => { // Handle OAuth callback route if (window.location.pathname === "/oauth/callback") { const OAuthCallback = React.lazy( @@ -61,6 +61,11 @@ const App = () => { ); } + + return ; +}; + +const App = () => { const [resources, setResources] = useState([]); const [resourceTemplates, setResourceTemplates] = useState< ResourceTemplate[] @@ -592,4 +597,4 @@ const App = () => { ); }; -export default App; +export default AppWrapper;