PageSourceSearch

https://reviewslift.ai/assets/auth.callback-BBMUuDiB.js

js reviewslift.ai collected 2026-10-05 13:57:26 UTC 2,238 bytes, 1 lines download raw bytes

1import{r as d,y as e,s as n,z as _,t as b,o as g,j as l}from"./index-B3BNobLj.js";import{c as f}from"./oauth-completion-D-2H6pXi.js";import{p as h}from"./pending-invite-gbJkc-EN.js";import{r as p}from"./admin-notify.functions-Bg5xnj8P.js";import{L as w}from"./loader-circle-DwB6SNxq.js";function v(){const[u,m]=d.useState("Signing you in…");return d.useEffect(()=>{(async()=>{try{e("callback_page_started"),await f({treatErrorAsFailure:!0});const{data:{user:a}}=await n.auth.getUser();if(e("callback_get_user_result",{hasUser:!!a,email:a?.email??null}),!a){e("callback_no_user_redirecting_login"),window.location.replace("/login?error=oauth_failed");return}const c=h();if(c){e("callback_pending_invite_redirect"),window.location.replace(c);return}let r=null;try{const t=localStorage.getItem("rl.pendingPlan");t&&(r=JSON.parse(t))}catch{}r?.plan&&!a.user_metadata?.selected_plan&&(await n.auth.updateUser({data:{selected_plan:r.plan,billing_cycle:r.billing??"monthly"}}),e("callback_pending_plan_applied",r));try{localStorage.removeItem("rl.pendingPlan")}catch(t){e("callback_pending_plan_remove_failed",{error:t instanceof Error?t.message:String(t)})}const{data:s}=await n.from("businesses").select("id, onboarding_complete").eq("user_id",a.id).maybeSingle();let o=!1;try{o=(await _())?.allowed===!0}catch{o=!1}const i=o?"/dashboard":"/checkout";if(!s){await n.from("businesses").insert({user_id:a.id,name:"My Business",email:a.email,onboarding_complete:!1}),b("google");try{await p({data:{attribution:g()}})}catch{}e("callback_business_created",{destination:i}),window.location.replace(i);return}try{await p({data:{attribution:g()}})}catch{}e("callback_business_found",{businessId:s.id,onboardingComplete:s.onboarding_complete,destination:i}),window.location.replace(i)}catch{e("callback_failed_redirecting_login"),m("Something went wrong. Redirecting…"),window.location.replace("/login?error=oauth_failed")}})()},[]),l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:l.jsxs("div",{className:"flex flex-col items-center gap-3 text-muted-foreground",children:[l.jsx(w,{className:"h-6 w-6 animate-spin text-primary"}),l.jsx("p",{className:"text-sm",children:u})]})})}export{v 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.