diff --git a/src/main.tsx b/src/main.tsx index 719464e3..d427691c 100755 --- a/src/main.tsx +++ b/src/main.tsx @@ -2,4 +2,9 @@ import { createRoot } from 'react-dom/client' import App from './App.tsx' import './index.css' -createRoot(document.getElementById("root")!).render(); +// If loaded inside an MSAL popup, don't render the app. +// The parent window's MSAL instance polls the popup URL for the auth code +// and processes it — no React needed here. +if (window.opener === null || window.opener === window) { + createRoot(document.getElementById("root")!).render(); +}