PageSourceSearch

https://orne-ai-launchpad.lovable.app/assets/OAuthConsent-CJfNyDUf.js

js orne-ai-launchpad.lovable.app collected 2026-10-03 03:35:20 UTC 2,421 bytes, 1 lines download raw bytes

1import{b6 as b,r as l,ax as g,j as e,H as S,J as v,at as y,au as A,av as E,K as _,Q as w}from"./index-A3FuQDYt.js";import{S as k}from"./shield-check-rbC9VX06.js";import{L as j}from"./loader-circle-CBfn6mAQ.js";const m=()=>g.auth.oauth;function R(){var x;const[C]=b(),t=C.get("authorization_id")??"",[s,z]=l.useState(null),[n,i]=l.useState(null),[u,d]=l.useState(!1);l.useEffect(()=>{let c=!0;return(async()=>{if(!t){i("Parâmetro authorization_id ausente.");return}const{data:a}=await g.auth.getSession();if(!a.session){const N=window.location.pathname+window.location.search;window.location.href="/admin?next="+encodeURIComponent(N);return}const{data:r,error:o}=await m().getAuthorizationDetails(t);if(!c)return;if(o){i(o.message);return}const p=(r==null?void 0:r.redirect_url)??(r==null?void 0:r.redirect_to);if(p&&!(r!=null&&r.client)){window.location.href=p;return}z(r)})(),()=>{c=!1}},[t]);async function h(c){d(!0);const{data:a,error:r}=c?await m().approveAuthorization(t):await m().denyAuthorization(t);if(r){d(!1),i(r.message);return}const o=(a==null?void 0:a.redirect_url)??(a==null?void 0:a.redirect_to);if(!o){d(!1),i("O servidor de autorização não retornou um redirecionamento.");return}window.location.href=o}const f=((x=s==null?void 0:s.client)==null?void 0:x.name)??"o aplicativo";return e.jsxs("main",{className:"grid min-h-screen place-items-center bg-background px-4",children:[e.jsxs(S,{children:[e.jsx("title",{children:"Autorizar acesso | Orne.ai"}),e.jsx("meta",{name:"robots",content:"noindex,nofollow"})]}),e.jsxs(v,{className:"w-full max-w-md",children:[e.jsxs(y,{children:[e.jsx("span",{className:"mb-2 grid h-10 w-10 place-items-center rounded-full bg-primary/10 text-primary",children:e.jsx(k,{className:"h-5 w-5"})}),e.jsx(A,{children:n?"Não foi possível autorizar":s?`Conectar ${f}`:"Carregando…"}),e.jsx(E,{children:n||(s?`${f} poderá usar as ferramentas do CMS da Orne.ai em seu nome, com as suas permissões.`:"Validando a solicitação de autorização.")})]}),e.jsxs(_,{className:"flex gap-3",children:[!n&&!s&&e.jsx(j,{className:"h-5 w-5 animate-spin text-muted-foreground"}),!n&&s&&e.jsxs(e.Fragment,{children:[e.jsxs(w,{className:"flex-1",disabled:u,onClick:()=>h(!0),children:[u&&e.jsx(j,{className:"mr-2 h-4 w-4 animate-spin"}),"Autorizar"]}),e.jsx(w,{variant:"outline",className:"flex-1",disabled:u,onClick:()=>h(!1),children:"Recusar"})]})]})]})]})}export{R 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.