diff --git a/admin-api-frontend/src/App.js b/admin-api-frontend/src/App.js index 735754a..69186a8 100644 --- a/admin-api-frontend/src/App.js +++ b/admin-api-frontend/src/App.js @@ -20,7 +20,7 @@ const App = ({ instance }) => { console.error("Ah fuck!") return null; } - instance.addEventCallback((event) => { if (event.eventType === EventType.SSO_SILENT_FAILURE && event.error?.errorCode === 'monitor_window_timeout') { instance.acquireTokenRedirect({ ...loginRequest, }); } }); + console.log(acct); return ( diff --git a/admin-api-frontend/src/index.js b/admin-api-frontend/src/index.js index d47a259..36774b6 100644 --- a/admin-api-frontend/src/index.js +++ b/admin-api-frontend/src/index.js @@ -14,6 +14,8 @@ import 'bootstrap/dist/css/bootstrap.min.css'; */ const msalInstance = new PublicClientApplication(msalConfig); +msalInstance.addEventCallback((event) => { if (event.eventType === EventType.SSO_SILENT_FAILURE && event.error?.errorCode === 'monitor_window_timeout') { instance.acquireTokenRedirect({ ...loginRequest, }); } }); + // Default to using the first account if no account is active on page load if (!msalInstance.getActiveAccount() && msalInstance.getAllAccounts().length > 0) { // Account selection logic is app dependent. Adjust as needed for different use cases.