%PDF- %PDF-
| Direktori : /home2/rezakur1/ai.rezakurnia.com/assets/ |
| Current File : /home2/rezakur1/ai.rezakurnia.com/assets/GoogleCallbackPage-DPK2qZ4n.js |
import{d as i,a as d,u as f,r as u,j as t}from"./index-CnB9nKbp.js";function g(){const[r]=i(),e=d(),{completeOAuth:s}=f(),n=u.useRef(!1);return u.useEffect(()=>{if(n.current)return;n.current=!0;const c=r.get("code"),o=r.get("state");if(!c||!o){e("/login",{replace:!0,state:{oauthError:"Kode otorisasi Google tidak ditemukan."}});return}const a={current:!1};return s(c,o).then(()=>{a.current||e("/dashboard",{replace:!0})}).catch(l=>{a.current||e("/login",{replace:!0,state:{oauthError:l.message}})}),()=>{a.current=!0}},[r,e,s]),t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[t.jsx("div",{className:"h-10 w-10 animate-spin rounded-full border-2 border-brand-500/30 border-t-brand-400"}),t.jsx("p",{className:"text-sm text-slate-500",children:"Menghubungkan akun Google…"})]})})}export{g as default};