PageSourceSearch

https://vera.ink/assets/oauth.consent-DpB3L1Nl.js

js vera.ink collected 2026-09-24 15:03:38 UTC 3,598 bytes, 1 lines download raw bytes

1import{f as j,r as c,j as e,s as u}from"./index-acTickSX.js";const v={openid:"Confirm your Vera identity",email:"Use your email to access your Vera account",profile:"Read your basic Vera profile",phone:"Read the phone number on your Vera account"};function m(t){try{return new URL(t).protocol==="https:"}catch{return!1}}function k(t){try{return new URL(t).hostname}catch{return"the approved app"}}function w(){const{authorization_id:t}=j.useSearch(),[n,b]=c.useState(null),[g,d]=c.useState(!0),[i,l]=c.useState(null),[p,a]=c.useState(null);c.useEffect(()=>{let r=!0;return(async()=>{if(!t){a("This connection request is missing or no longer valid."),d(!1);return}const{data:s,error:o}=await u.auth.oauth.getAuthorizationDetails(t);r&&(o||!s?a(o?.message??"Could not load this connection request."):"redirect_url"in s?m(s.redirect_url)?window.location.assign(s.redirect_url):a("The app returned an unsafe redirect address."):b(s),d(!1))})(),()=>{r=!1}},[t]);const x=async r=>{if(!t||i)return;l(r),a(null);const h=r==="approve"?u.auth.oauth.approveAuthorization:u.auth.oauth.denyAuthorization,{data:s,error:o}=await h(t,{skipBrowserRedirect:!0});if(o||!s){a(o?.message??"Could not save your choice."),l(null);return}if(!m(s.redirect_url)){a("The app returned an unsafe redirect address."),l(null);return}window.location.assign(s.redirect_url)},f=n?.scope.split(/\s+/).filter(Boolean)??[],y=n?k(n.redirect_uri):"";return e.jsx("main",{className:"min-h-screen bg-[#06090f] flex items-center justify-center px-6 py-12",children:e.jsxs("section",{className:"w-full max-w-[520px] font-mono-vera text-[rgba(221,216,204,0.85)]",children:[e.jsx("p",{className:"text-[9px] tracking-[0.28em] text-[#2A9D8F] uppercase mb-6 text-center",children:"vera.ink"}),e.jsx("h1",{className:"text-[13px] tracking-[0.3em] uppercase text-[#2A9D8F] mb-8 text-center",children:"Connect an app."}),g&&e.jsx("p",{className:"text-[11px] text-center",children:"Checking request…"}),n&&e.jsxs("div",{className:"border border-[rgba(255,255,255,0.12)] bg-[rgba(255,255,255,0.025)] p-6",children:[e.jsx("p",{className:"text-[12px] text-[rgba(221,216,204,0.95)] mb-2",children:n.client.name}),e.jsxs("p",{className:"text-[10px] text-[rgba(221,216,204,0.62)] mb-6",children:["Returns to ",y]}),e.jsx("p",{className:"text-[10px] tracking-[0.16em] uppercase text-[#2A9D8F] mb-3",children:"This app is asking to"}),e.jsxs("ul",{className:"text-[11px] leading-6 mb-6 pl-5 list-disc",children:[f.map(r=>e.jsx("li",{children:v[r]??`Use the ${r} permission`},r)),e.jsx("li",{children:"Access your Vera packs and evidence through Vera tools"})]}),e.jsx("p",{className:"text-[10px] leading-5 text-[rgba(221,216,204,0.62)] mb-6",children:"Vera tools can use credits only when you ask for a paid query, verification, or pack build. Pack-build ceilings still require your explicit approval."}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{type:"button",onClick:()=>{x("approve")},disabled:i!==null,className:"flex-1 py-3 px-4 text-[10px] tracking-[0.18em] uppercase bg-[#2A9D8F] text-[#06090f] border-0 cursor-pointer disabled:opacity-60",children:i==="approve"?"Connecting…":"Allow"}),e.jsx("button",{type:"button",onClick:()=>{x("deny")},disabled:i!==null,className:"flex-1 py-3 px-4 text-[10px] tracking-[0.18em] uppercase bg-transparent text-[rgba(221,216,204,0.7)] border border-[rgba(255,255,255,0.18)] cursor-pointer disabled:opacity-60",children:i==="deny"?"Declining…":"Decline"})]})]}),p&&e.jsx("p",{role:"alert",className:"text-[11px] leading-5 text-red-400 text-center",children:p})]})})}export{w 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.