Fix MSAL popup loading full app — skip React render when in popup context
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 <noreply@anthropic.com>
This commit is contained in:
parent
2154ce946d
commit
3943be1c51
1 changed files with 6 additions and 1 deletions
|
|
@ -2,4 +2,9 @@ import { createRoot } from 'react-dom/client'
|
|||
import App from './App.tsx'
|
||||
import './index.css'
|
||||
|
||||
createRoot(document.getElementById("root")!).render(<App />);
|
||||
// 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(<App />);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue