mirror of
https://github.com/okieselbach/AutopilotMonitor.git
synced 2026-10-26 05:29:43 +00:00
97ca48f56a
Root cause: MSAL fires handleRedirectPromise twice on page load, causing isAuthenticated to briefly flip false between the two settlements. This triggered ProtectedRoute to redirect to '/', which then re-authenticated and redirected to '/dashboard', causing the dashboard page to mount and unmount periodically while the user was viewing a session. Two fixes: 1. navigateToLoginRequestUrl: false — prevents MSAL from navigating to the stored login request URL after redirect settlement, eliminating the spurious navigation that caused the dashboard to mount. 2. ProtectedRoute unauthenticated redirect now waits 500ms before executing, giving MSAL time to complete its double-settlement cycle before we conclude the user is truly unauthenticated. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>