PageSourceSearch

https://bizplanner.ai/assets/OAuthConsent-DbeOmmX-.js

js bizplanner.ai collected 2026-10-05 11:51:46 UTC 2,466 bytes, 1 lines download raw bytes

1import{a as v,r as o,s as w,j as e,d as g,B as j}from"./index-NwEFhPA0.js";const u=w.auth.oauth;function k(){var x;const[b]=v(),r=b.get("authorization_id")??"",[d,y]=o.useState(null),[m,a]=o.useState(null),[c,l]=o.useState(!1);o.useEffect(()=>{let i=!0;return(async()=>{if(!r)return a("Missing authorization_id");const{data:s}=await w.auth.getSession();if(!s.session){const N=window.location.pathname+window.location.search;window.location.href="/auth?next="+encodeURIComponent(N);return}const{data:t,error:n}=await u.getAuthorizationDetails(r);if(!i)return;if(n)return a(n.message);const p=(t==null?void 0:t.redirect_url)??(t==null?void 0:t.redirect_to);if(p&&!(t!=null&&t.client)){window.location.href=p;return}y(t)})(),()=>{i=!1}},[r]);async function h(i){l(!0);const{data:s,error:t}=i?await u.approveAuthorization(r):await u.denyAuthorization(r);if(t)return l(!1),a(t.message);const n=(s==null?void 0:s.redirect_url)??(s==null?void 0:s.redirect_to);if(!n)return l(!1),a("No redirect returned by the authorization server.");window.location.href=n}if(m)return e.jsx("main",{className:"min-h-screen flex items-center justify-center bg-background p-6",children:e.jsxs("div",{className:"max-w-md w-full rounded-lg border bg-card p-6 space-y-2",children:[e.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Authorization error"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:m})]})});if(!d)return e.jsx("main",{className:"min-h-screen flex items-center justify-center bg-background",children:e.jsx(g,{className:"w-6 h-6 animate-spin text-muted-foreground"})});const f=((x=d.client)==null?void 0:x.name)??"an app";return e.jsx("main",{className:"min-h-screen flex items-center justify-center bg-background p-6",children:e.jsxs("div",{className:"max-w-md w-full rounded-lg border bg-card p-6 space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("h1",{className:"text-xl font-semibold text-foreground",children:["Connect ",f," to Bizplanner.ai"]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[f," is requesting access to use Bizplanner.ai tools on your behalf. You can revoke this access at any time from your account."]})]}),e.jsxs("div",{className:"flex gap-2 justify-end",children:[e.jsx(j,{variant:"outline",disabled:c,onClick:()=>h(!1),children:"Deny"}),e.jsx(j,{disabled:c,onClick:()=>h(!0),children:c?e.jsx(g,{className:"w-4 h-4 animate-spin"}):"Approve"})]})]})})}export{k 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.