PageSourceSearch

https://databento.com/assets/OAuthConsent-CrV3kb3p.js

js databento.com collected 2026-10-03 20:25:58 UTC 2,465 bytes, 4 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="b4c21e8c-b542-5d5a-b9de-55834f855756")}catch(e){}}();import{h as b,r as a,nD as p,j as e,B as f}from"./index-CFzO_Joo.js";import{P as x,D as m,a as y}from"./PageLayout-DP7gSMoZ.js";import{D as g}from"./PageContent-DYyrm-_H.js";import"./OverlayScrollbars-BefcabK9.js";import"./overlayscrollbars-react.esm-BS0V9EpA.js";const v=()=>{const{search:j}=b(),t=new URLSearchParams(j).get("consent_challenge")??"",[s,w]=a.useState(null),[o,d]=a.useState(null),[i,h]=a.useState(!1);a.useEffect(()=>{t&&fetch(`${p}/v0/oauth/consent/info?consent_challenge=${encodeURIComponent(t)}`,{credentials:"include"}).then(n=>{if(!n.ok)throw new Error(`${n.status}`);return n.json()}).then(w).catch(()=>d("Unable to load authorization details. Please try again."))},[t]);const u=a.useCallback(async n=>{h(!0);try{const c=new URLSearchParams({consent_challenge:t,accepted:String(n)});(s?.scopes??[]).forEach(l=>c.append("scopes",l)),(s?.audiences??[]).forEach(l=>c.append("audiences",l));const r=await fetch(`${p}/v0/oauth/consent`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},credentials:"include",body:c.toString()});if(!r.ok)throw new Error(`${r.status}`);const{redirect_to:P}=await r.json();window.location.assign(P)}catch{d("Authorization failed. Please try again."),h(!1)}},[t,s]);return t?e.jsxs(x,{children:[e.jsx(m,{children:"Authorize Databento MCP"}),e.jsxs(g,{children:[o&&e.jsx("p",{className:"text-red-500 mb-4",children:o}),!s&&!o&&e.jsx("p",{children:"Loading…"}),s&&e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("p",{children:"An application is requesting access to your Databento account with the following permissions:"}),e.jsx("ul",{className:"list-disc pl-6",children:s.scopes.map(n=>e.jsx("li",{children:n},n))}),e.jsxs(y,{children:[e.jsx(f,{disabled:i,spinner:i,onClick:()=>{u(!0)},children:"Authorize"}),e.jsx(f,{disabled:i,variant:"outline",onClick:()=>{u(!1)},children:"Deny"})]})]})]})]}):e.jsxs(x,{children:[e.jsx(m,{children:"Authorization"}),e.jsx(g,{children:e.jsx("p",{children:"Invalid request: missing consent challenge."})})]})};export{v as default};
2//# sourceMappingURL=OAuthConsent-CrV3kb3p.js.map
3
4//# chunkId=b4c21e8c-b542-5d5a-b9de-55834f855756

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.