import{aS as u,r as s,b as d,j as a,a$ as m,Q as r,g as i,aU as g,cv as h,cw as x}from"./index-ea7817a2.js";const j=()=>{const t=u(),c=s.useCallback(()=>window.location.reload(),[]),[o,l]=s.useState(null),e=new URLSearchParams(window.location.search).get("providerName");return s.useEffect(()=>{e||t(d.auth.login),(async()=>{try{if(e!==null){const n=await h.oauthLoginURI(e);window.open(n,"_self")}}catch(n){l(x(n,"OAuth configuration error"))}})()},[t,e]),o===null?a.jsx(m,{}):a.jsxs(r,{flexDirection:"column",alignItems:"center",my:"auto",children:[a.jsxs(i,{fontSize:"22px",mb:"11px",children:["Error logging you in with ",e]}),a.jsx(i,{mb:"40px",children:o==null?void 0:o.message}),a.jsx(r,{children:a.jsx(g,{intent:"secondary",onClick:c,mr:"14px",children:"Reload"})})]})};export{j as default};
