1import{b as S,j as e}from"./mui-vendor-EnF583WJ.js";import{a as T,b as A,B as U,t as h,E as x,f as y,n as u,y as g,l as H,H as j,A as m,R as f,w as D,C as I}from"./index-Cjq4mjPV.js";import{u as w}from"./use-login-google-DtZdoK1n.js";import{U as R}from"./user-has-been-delete-dialog-ChCt5IFx.js";import"./useMutation-DiMWpr_a.js";const N=()=>{const{t:i}=T(),t=A(),c=U(),{code:d}=h({from:"/login/google/callback"}),r=x(),p=w(),E=()=>{const _={code:d,redirectUri:window.location.origin+window.location.pathname};p.mutate(_,{onSuccess:async o=>{if("errorCode"in o){const{errorCode:l,authToken:C}=o;if(l==="AUTH-401"){r.onTrue();return}if(l==="AUTH-101"&&localStorage.setItem(j,C),l==="AUTH-104"){g.error(i("login_dialog_user_not_found_title")),u(),t({to:"/login",replace:!0});return}n();return}const{access_token:s,refresh_token:a}=o;if(o.mfaEnforcementPolicy==="REQUIRED"&&!o.mfaActivatedStatus){localStorage.setItem(m,s),localStorage.setItem(f,a),t({to:"/setting-2fa",replace:!0});return}localStorage.setItem(m,s),localStorage.setItem(f,a),await c.resetQueries(),c.fetchQuery(D.userProfileOptions()),n()},onError:async o=>{const a=await o.response.json();if(a.errorCode==="AUTH-401"){r.onTrue();return}if(a.errorCode==="AUTH-104"){if(g.error(i("login_dialog_user_not_found_title")),localStorage.getItem(H)){t({to:"/redeem",replace:!0});return}t({to:"/login",replace:!0});return}n()}})},n=()=>{t({to:"/landing"})};return S.useEffect(()=>{E()},[]),e.jsxs(e.Fragment,{children:[!r.value&&e.jsx(y,{}),e.jsx(R,{open:r.value,onClose:()=>{u(),r.onFalse(),t({to:"/login",replace:!0})}})]})},O={title:`Google Login | ${I.appName}`};function v(){return e.jsxs(e.Fragment,{children:[e.jsx("title",{children:O.title}),e.jsx(N,{})]})}const Q=v;export{Q as component};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.