UNPKG

spa-entra-id

Version:

Single Page Application with Azure Entra ID authentication using MSAL

2 lines (1 loc) 410 B
import{P as e,m as n}from"./config-DsmLiMCp.js";async function t(){try{const o=new e(n);await o.initialize(),await o.handleRedirectPromise()?(window.close(),window.location.href="/"):(o.getAllAccounts().length>0&&window.close(),window.location.href="/")}catch(o){console.error("Authentication callback error:",o),setTimeout(()=>{window.location.href="/"},2e3)}}document.addEventListener("DOMContentLoaded",t);