import{aR as u,r as s,e as d,j as a,a_ as m,a as r,f as i,aT as x,cu as h,cv as f}from"./index-d6499a22.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(f(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(x,{intent:"secondary",onClick:c,mr:"14px",children:"Reload"})})]})};export{j as default};
