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