PageSourceSearch

https://postpro-ai.netlify.app/assets/WhopCallback-CZCzZvef.js

js postpro-ai.netlify.app collected 2026-10-03 11:17:45 UTC 2,586 bytes, 1 lines download raw bytes

1import{j as e}from"./framer-CaZKyxF5.js";import{r as n}from"./react-core-I1an5Yvj.js";import{d as g,b as f}from"./router-hu0_X6IN.js";import{u as w}from"./useWhopAuth-DDbJa5Lk.js";import{C as N,a as C,b as y,c as b}from"./card-C-2cYgJJ.js";import{B as v}from"./index-CgQCMZLE.js";import{e as d,i as u,ag as p}from"./lucide-DPOR83NI.js";import"./supabase-LX2YIkpS.js";import"./query-C2oTuvQ4.js";const M=()=>{const[t]=g(),c=f(),{handleWhopCallback:i}=w(),[s,a]=n.useState("loading"),[x,r]=n.useState("Processing authentication...");n.useEffect(()=>{(async()=>{const o=t.get("code"),j=t.get("state"),l=t.get("error");if(l){a("error"),r(`Authentication failed: ${l}`);return}if(!o){a("error"),r("No authorization code received");return}try{await i(o,j||void 0)?(a("success"),r("Authentication successful! Redirecting..."),setTimeout(()=>{window.parent!==window?window.parent.postMessage({type:"whop_auth_success",redirect:"/whop-app"},"*"):c("/whop-app",{replace:!0})},2e3)):(a("error"),r("Authentication failed. Please try again."))}catch(m){console.error("Callback processing error:",m),a("error"),r("An unexpected error occurred during authentication.")}})()},[t,i,c]);const h=()=>{c("/whop-app",{replace:!0})};return e.jsx("div",{className:"min-h-screen flex items-center justify-center p-4",children:e.jsxs(N,{className:"w-full max-w-md",children:[e.jsx(C,{className:"text-center",children:e.jsxs(y,{className:"flex items-center justify-center space-x-2",children:[s==="loading"&&e.jsxs(e.Fragment,{children:[e.jsx(d,{className:"h-5 w-5 animate-spin text-primary"}),e.jsx("span",{children:"Authenticating"})]}),s==="success"&&e.jsxs(e.Fragment,{children:[e.jsx(u,{className:"h-5 w-5 text-green-500"}),e.jsx("span",{className:"text-green-600",children:"Success!"})]}),s==="error"&&e.jsxs(e.Fragment,{children:[e.jsx(p,{className:"h-5 w-5 text-red-500"}),e.jsx("span",{className:"text-red-600",children:"Error"})]})]})}),e.jsxs(b,{className:"text-center space-y-4",children:[e.jsx("p",{className:"text-muted-foreground",children:x}),s==="loading"&&e.jsx("div",{className:"flex justify-center",children:e.jsx(d,{className:"h-8 w-8 animate-spin text-primary"})}),s==="success"&&e.jsxs("div",{className:"text-green-600",children:[e.jsx(u,{className:"h-12 w-12 mx-auto mb-2"}),e.jsx("p",{className:"text-sm",children:"You will be redirected automatically..."})]}),s==="error"&&e.jsxs("div",{className:"space-y-4",children:[e.jsx(p,{className:"h-12 w-12 mx-auto text-red-500"}),e.jsx(v,{onClick:h,variant:"outline",className:"w-full",children:"Try Again"})]})]})]})})};export{M 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.