1import{v as k,r as o,s as b,j as e}from"./index-Ca3YKre7.js";const u=b.auth.oauth;function N(){var h,p;const[z]=k(),r=z.get("authorization_id")??"",[l,y]=o.useState(null),[m,n]=o.useState(null),[c,d]=o.useState(!1);o.useEffect(()=>{let i=!0;return(async()=>{if(!r){n("Hiányzó authorization_id paraméter.");return}const{data:s}=await b.auth.getSession();if(!s.session){const j=window.location.pathname+window.location.search;window.location.href="/login?next="+encodeURIComponent(j);return}const{data:t,error:a}=await u.getAuthorizationDetails(r);if(!i)return;if(a)return n(a.message);const g=(t==null?void 0:t.redirect_url)??(t==null?void 0:t.redirect_to);if(g&&!(t!=null&&t.client)){window.location.href=g;return}y(t)})(),()=>{i=!1}},[r]);async function f(i){d(!0);const{data:s,error:t}=i?await u.approveAuthorization(r):await u.denyAuthorization(r);if(t)return d(!1),n(t.message);const a=(s==null?void 0:s.redirect_url)??(s==null?void 0:s.redirect_to);if(!a)return d(!1),n("Az autorizációs szerver nem adott vissza redirect URL-t.");window.location.href=a}if(m)return e.jsx("main",{className:"min-h-screen bg-background text-foreground flex items-center justify-center p-6",children:e.jsxs("div",{className:"glass-card p-8 max-w-md w-full",children:[e.jsx("h1",{className:"text-lg font-bold mb-2",children:"Nem sikerült betölteni a kérést"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:m})]})});if(!l)return e.jsx("main",{className:"min-h-screen bg-background text-foreground flex items-center justify-center p-6",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Betöltésâ¦"})});const x=((h=l.client)==null?void 0:h.name)??((p=l.client)==null?void 0:p.client_name)??"egy alkalmazás";return e.jsx("main",{className:"min-h-screen bg-background text-foreground flex items-center justify-center p-6",children:e.jsxs("div",{className:"glass-card p-8 max-w-md w-full space-y-6",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-xl font-bold mb-2",children:["Csatlakoztatod a(z) ",e.jsx("span",{className:"text-primary",children:x})," alkalmazást az Affilion Web3 fiókodhoz?"]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Ezzel a(z) ",x," a te nevedben tudja használni az Affilion Web3 elérhetÅ MCP eszközeit (cikkek olvasása, social linkek). Ez nem kerüli meg az alkalmazás jogosultságait vagy a backend szabályait."]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{disabled:c,onClick:()=>f(!0),className:"flex-1 px-4 py-3 rounded-xl bg-primary text-primary-foreground text-sm font-semibold hover:opacity-90 disabled:opacity-50",children:c?"Feldolgozásâ¦":"Jóváhagyás"}),e.jsx("button",{disabled:c,onClick:()=>f(!1),className:"flex-1 px-4 py-3 rounded-xl bg-secondary border border-border text-sm font-semibold hover:opacity-90 disabled:opacity-50",children:"ElutasÃtás"})]})]})})}export{N 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.