1import{u as l,r as u,j as i,L as d,s as c,J as s}from"./index-ZkJ-s1rB.js";const f=()=>{const r=l();return u.useEffect(()=>{(async()=>{try{const{data:{session:e},error:o}=await c.auth.getSession();if(o)throw o;if(!e){s.error("No session found. Please try signing in again."),r("/auth");return}const t=e.provider_token,n=e.provider_refresh_token;t&&n?setTimeout(async()=>{const{error:a}=await c.from("profiles").update({google_access_token:t,google_refresh_token:n,google_token_expires_at:new Date(Date.now()+(e.expires_in||3600)*1e3).toISOString()}).eq("id",e.user.id);a?(console.error("Failed to store tokens:",a.message),s.error("Failed to save Google tokens")):s.success("Google connected!")},0):s.info("Signed in successfully"),window.opener?(window.opener.postMessage({type:"auth-success",access_token:e.access_token,refresh_token:e.refresh_token},window.location.origin),setTimeout(()=>window.close(),150)):r("/",{replace:!0})}catch(e){console.error("Auth callback error:",(e==null?void 0:e.message)||"Unknown error");const o=(e==null?void 0:e.message)||"Authentication failed";s.error(o),window.opener?(window.opener.postMessage({type:"auth-error",error:o},window.location.origin),setTimeout(()=>window.close(),100)):r("/auth",{replace:!0})}})()},[r]),i.jsx("div",{className:"min-h-screen flex items-center justify-center",children:i.jsx(d,{className:"h-6 w-6 animate-spin text-primary"})})};export{f as default};
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.