From 3943be1c51da75ad109226679e12ea1452147893 Mon Sep 17 00:00:00 2001 From: Vadym Samoilenko Date: Fri, 20 Mar 2026 14:35:25 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20MSAL=20popup=20loading=20full=20app=20?= =?UTF-8?q?=E2=80=94=20skip=20React=20render=20when=20in=20popup=20context?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MSAL parent polls popup URL for auth code (same-origin), so the popup doesn't need to render anything. Prevents app from opening inside popup. Co-Authored-By: Claude Sonnet 4.6 --- src/main.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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(); +}