PageSourceSearch

https://stellate.co/_next/static/chunks/pages/cli-auth-ca93a8caf4b7764e.js

js stellate.co collected 2026-09-24 17:37:44 UTC 15,204 bytes, 7 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9541],{36749:(e,t,i)=>{"use strict";i.d(t,{P:()=>r});var a=i(43696);function r({...e}){return(0,a.FD)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1259 392",...e,children:[(0,a.Y)("path",{fill:"#fff",opacity:.6,fillRule:"evenodd",d:"m328.93 308.35.27-.16c6.07-3.64 10.5-9.49 12.4-16.33a27.819 27.819 0 0 0-2.23-20.42l-31.64-60.28L69.49 337.33l85.22 49.42a38.88 38.88 0 0 0 39.02 0l135.2-78.4ZM42.9 243.33 234.04 28.62 193.73 5.25a38.88 38.88 0 0 0-39.02 0l-135.2 78.4A39.077 39.077 0 0 0 5.23 98 39.292 39.292 0 0 0 0 117.6V147c0 18.18 3.82 36.16 11.21 52.76 7.39 16.6 18.19 31.44 31.68 43.56Z"}),(0,a.Y)("path",{fill:"#fff",fillRule:"evenodd",d:"M328.93 83.65 324.37 81 215.31 181.73l91.47 79.62c14.42 12.55 19.76 30.85 14.19 51.65l7.97-4.61c5.94-3.45 10.87-8.4 14.3-14.37a39.393 39.393 0 0 0 5.22-19.63V117.6c0-6.88-1.8-13.64-5.23-19.6a39.077 39.077 0 0 0-14.28-14.35ZM169.54 224.72 43.52 127.06C29.31 116 22.9 99.45 25.82 80l-6.3 3.65A39.077 39.077 0 0 0 5.24 98 39.199 39.199 0 0 0 0 117.6v156.8c0 6.89 1.79 13.66 5.22 19.63a39.11 39.11 0 0 0 14.3 14.37l36.1 20.93 113.93-104.61Z"}),(0,a.Y)("path",{d:"M527.56 286.11c37.51 0 58.2-20.68 58.2-48.1 0-60.6-88.01-41.84-88.01-78.4 0-12.75 9.86-22.36 27.9-22.36s28.86 11.54 29.82 27.9h27.9c-1.44-29.82-23.33-53.15-57.71-53.15s-55.79 20.44-55.79 47.13c0 59.88 88.01 42.32 88.01 79.6 0 12.26-9.86 22.12-30.06 22.12s-32.22-12.02-33.91-29.34h-27.9c1.44 31.5 24.29 54.59 61.56 54.59Zm127.56 0c6.49 0 11.3-1.2 14.43-2.4v-24.05c-2.4 1.2-5.29 1.68-8.42 1.68-10.82 0-18.04-6.25-18.04-19.72v-56.27h26.45v-23.81h-26.45v-31.26h-22.85v18.28c0 9.38-5.05 14.43-14.67 14.43h-8.66v22.36h19.96v58.44c0 26.69 16.11 42.32 38.24 42.32ZM802 219.74c0-34.63-25.49-61.08-57.96-61.08s-60.12 28.14-60.12 63.73 26.69 63.73 60.36 63.73c26.69 0 46.65-19 53.39-36.55h-27.41c-4.33 6.25-12.5 12.75-26.21 12.75-17.31 0-30.3-11.06-33.67-29.58h90.18c.72-2.65 1.44-7.21 1.44-12.99Zm-57.96-37.27c16.35 0 29.34 12.26 32.22 30.3h-65.89c3.37-18.52 17.07-30.3 33.67-30.3Zm109.07 100.76V114.89h-26.45v168.33h26.45Zm59.42 0V114.89h-26.45v168.33h26.45Zm77.45-124.57c-29.34 0-45.93 19.48-48.1 39.92h26.45c1.44-7.94 8.18-16.11 21.4-16.11s22.6 8.9 22.6 23.57v4.09h-19.48c-33.43 0-56.51 15.39-56.51 39.68 0 19.96 17.07 36.31 40.88 36.31 19.48 0 30.78-10.34 35.59-16.59h1.2l4.81 13.71h19.72v-75.03c0-29.58-18.76-49.54-48.58-49.54Zm-7.21 105.09c-13.23 0-19.96-6.73-19.96-16.11 0-11.06 9.62-18.52 30.3-18.52h19.24v7.7c0 14.43-11.54 26.93-29.58 26.93Zm129.35 22.36c6.49 0 11.3-1.2 14.43-2.4v-24.05c-2.4 1.2-5.29 1.68-8.42 1.68-10.82 0-18.04-6.25-18.04-19.72v-56.27h26.45v-23.81h-26.45v-31.26h-22.85v18.28c0 9.38-5.05 14.43-14.67 14.43h-8.66v22.36h19.96v58.44c0 26.69 16.11 42.32 38.24 42.32ZM1259 219.74c0-34.63-25.49-61.08-57.95-61.08s-60.12 28.14-60.12 63.73 26.69 63.73 60.36 63.73c26.69 0 46.65-19 53.39-36.55h-27.41c-4.33 6.25-12.5 12.75-26.21 12.75-17.31 0-30.3-11.06-33.67-29.58h90.18c.72-2.65 1.44-7.21 1.44-12.99Zm-57.95-37.27c16.35 0 29.34 12.26 32.22 30.3h-65.89c3.37-18.52 17.07-30.3 33.67-30.3Z",fill:"#fff"})]})}},42047:(e,t,i)=>{"use strict";function a(){return document.cookie.split(";").some(e=>e.trim().startsWith("demo_session=true"))}i.d(t,{G:()=>a})},47642:(e,t,i)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/cli-auth",function(){return i(92307)}])},79794:(e,t,i)=>{"use strict";i.d(t,{$:()=>l});var a=i(43696),r=i(1224),n=i(42155),s=i.n(n);let l=(0,r.forwardRef)(({className:e="",small:t,full:i,secondary:r,hasArrow:n,color:l="none",loading:c,pageType:d="product",destructive:h,children:m,tabIndex:u=0,disabled:f,...g},v)=>(0,a.FD)("button",{tabIndex:u,ref:v,className:s()(`text-center whitespace-nowrap flex items-center ${"marketing"===d?"font-demibold leading-none focus:outline-blue w-fit-content":"font-medium focus:ring focus:outline-none sm:w-auto"} rounded-6 transition sm:flex-shrink-0 sm:inline-flex sm:items-center`,{"bg-neutral-10 hover:bg-neutral-15 text-neutral ring-neutral":r,"bg-blue text-white hover:opacity-85 svg-white":!r&&!h&&"white"!==l&&"product"===d,"w-full flex items-center justify-center":i,"text-lg py-3.5 px-4.25 leading-1.3":!t&&"product"===d,"py-3.25 px-3.75 text-18":!t&&"marketing"===d,"px-2.5 py-1.5 text-base leading-1.5":t&&"product"===d,"px-2.5 py-1.5 
1small-body-text":t&&"marketing"===d,"cursor-not-allowed pointer-events-none":c,"cursor-not-allowed pointer-events-none opacity-75":f,"bg-blue text-white hover:opacity-85 ring-blue svg-white":"blue"===l&&"product"===d,"bg-blue text-white hover:bg-blue-110 svg-white":"blue"===l&&"marketing"===d,"bg-magenta text-white hover:opacity-85 ring-magenta svg-white":"magenta"===l&&"product"===d,"bg-magenta text-white hover:bg-magenta-110 svg-white":"magenta"===l&&"marketing"===d,"bg-red text-white hover:opacity-85 ring-red svg-white":(h||"red"===l)&&"product"===d,"bg-red text-white hover:bg-red-110 svg-white":(h||"red"===l)&&"marketing"===d,"bg-white hover:opacity-85 text-blue ring-white svg-blue":"white"===l&&"product"===d,"bg-white hover:bg-opacity-85 text-blue-110 ring-white svg-blue":"white"===l&&"marketing"===d},e),disabled:f,...g,children:[m,n&&(0,a.Y)(o,{className:"h-3 w-auto flex-shrink-0 pl-2.5"})]}));l.displayName="Button";let o=({...e})=>(0,a.Y)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"9",height:"14",fill:"none",viewBox:"0 0 9 14",...e,children:(0,a.Y)("path",{stroke:"currentColor",strokeWidth:"2",d:"M1 12.94l6-5.97L1 1"})})},92307:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>N});var a=i(43696),r=i(1224),n=i(56448),s=i(48651),l=i(77990),o=i.n(l),c=i(36749),d=i(12675),h=i(60672),m=i(49462),u=i(61784),f=i(42047);let g=({dark:e=!1})=>{let{user:t}=(0,u.ur)(),[i,n]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{n((0,f.G)())},[]),(0,a.Y)(d.W,{children:({open:r})=>(0,a.FD)("div",{className:`relative pt-6 md:pt-10 ${e&&"bg-dark"}`,children:[(0,a.Y)("div",{className:"max-w-6xl px-8 mx-auto",children:(0,a.FD)("nav",{className:"relative flex items-center justify-between md:justify-center",children:[(0,a.Y)("div",{className:"flex items-center flex-1",children:(0,a.FD)("div",{className:"flex items-center justify-between w-full md:w-auto",children:[(0,a.Y)(o(),{href:"/","aria-label":"Home",children:e?(0,a.Y)(c.P,{className:"h-12 md:h-16",width:181,height:50}):(0,a.Y)(m.g,{className:"h-12 md:h-16",width:181,height:50})}),(0,a.Y)("div",{className:"flex items-center mr-0 md:hidden",children:(0,a.Y)(d.W.Button,{className:"inline-flex items-center justify-center p-2 text-gray-400 transition duration-150 ease-in-out rounded-md hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 focus:text-gray-500","aria-label":"Main menu","aria-haspopup":"true",children:(0,a.Y)("svg",{className:"w-6 h-6",stroke:"currentColor",fill:"none",viewBox:"0 0 24 24",children:(0,a.Y)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})})]})}),(0,a.Y)("div",{className:"hidden md:flex md:items-center md:justify-end",children:(0,a.FD)("div",{className:"hidden md:flex md:space-x-10",children:[(0,a.Y)(o(),{href:"/about",className:`font-medium transition duration-150 ease-in-out ${e?"text-gray-400 hover:text-gray-500":"text-gray-700 hover:text-gray-500"}`,children:"About"}),t&&!i&&(0,a.Y)(o(),{href:"/app",className:`font-medium transition duration-150 ease-in-out ${e?"text-gray-400 hover:text-gray-500":"text-gray-700 hover:text-gray-500"}`,children:"Dashboard"})]})})]})}),(0,a.Y)("div",{className:"relative top-0 -mt-16",children:(0,a.Y)(h.e,{show:r,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:(0,a.Y)(d.W.Items,{static:!0,className:"absolute inset-x-0 right-0 z-10 p-2 origin-top-right outline-none",children:(0,a.Y)("div",{className:"rounded-lg shadow-md",children:(0,a.FD)("div",{className:"overflow-hidden bg-white rounded-lg shadow-xs",role:"menu","aria-orientation":"vertical","aria-labelledby":"main-menu",children:[(0,a.FD)("div",{className:"flex items-center justify-between px-5 pt-4",children:[(0,a.Y)(o(),{href:"/",children:(0,a.Y)(d.W.Button,{children:(0,a.Y)(m.g,{className:"w-auto h-8"})})}),(0,a.Y)("div",{className:"-mr-2",children:(0,a.Y)(d.W.Button,{className:"inline-flex items-center justify-center p-2 text-gray-400 transition duration-150 ease-in-out rounded-md outline-none hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 focus:text-gray-500",children:(0,a.Y)("svg",{className:"w-6 h-6",stroke:"currentColor",fill:"none",viewBox:"0 0 24 24",children:(0,a.Y)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})})]}),(0,a.FD)("div",{className:"px-2 pt-2 pb-3",children:[(0,a.Y)(o(),{href:"/about",className:"block px-3 py-2 text-base font-medium text-gray-700 transition duration-150 ease-in-out rounded-md hover:text-gray-200 hover:bg-gray-50 focus:outline-none focus:text-gray focus:bg-gray-50",role:"menuitem",children:"About"}),t&&!i&&(0,a.Y)(o(),{href:"/app",className:"block px-3 py-2 text-base font-medium text-gray-700 transition duration-150 ease-in-out rounded-md hover:text-gray-200 hover:bg-gray-50 focus:outline-none focus:text-gray focus:bg-gray-50",role:"menuitem",children:"Dashboard"})]}),(0,a.Y)("div",{})]})})})})}),(0,a.Y)("div",{className:"pb-16"})]})})};var v=i(99694);let x=e=>(0,a.Y)("pre",{className:`inline-flex items-center mx-1 px-1.5 py-0.5 rounded text-xs font-medium bg-lightBlue-100 text-blue-110 ${e.className||""}`,children:e.children});var p=i(15970),y=i(94764),w=i(79794);let b=(0,n.J1)`
2  mutation authorizeLoginRequest($code: String!) {
3    authorizeLoginRequest(code: $code)
4  }
5`;function N(){let{login:e,user:t}=(0,u.ur)(),[i,l]=(0,r.useState)("loading"),[o,c]=(0,r.useState)(null),d=(0,s.useRouter)(),h=d.query?.code,[m,f]=(0,r.useState)(),[N,Y]=(0,r.useState)(!1);(0,r.useEffect)(()=>{(async()=>
5{if(h)if(0)l("confirm");else try{let t=await fetch("/api/auth/refresh",{method:"GET",credentials:"include"});if(t.ok){let e=await t.json();if(e.hasTokens&&e.token){c(e.token),l("confirm");return}}else{let e=await t.json().catch(()=>({}));if("TOKEN_EXPIRED"===e.error&&e.needsRefresh){let e=await fetch("/api/auth/refresh",{method:"POST",credentials:"include"});if(e.ok){let t=await e.json();if(t.success&&t.token){c(t.token),l("confirm");return}}}}e()}catch(t){e()}})()},[h]);let k=(0,r.useCallback)(async()=>{if(!h)return;l("authorizing");let t=(0,n.UU)({url:"https://stellate-api.stellate.sh",requestPolicy:"cache-and-network",fetchOptions:{credentials:"include",...o?{headers:{Authorization:`Bearer ${o}`}}:{}},exchanges:[n.cI]}),i=await t.mutation(b,{code:h}).toPromise();i.error?i.error.graphQLErrors.some(e=>e.extensions?.code==="UNAUTHENTICATED")?e():(f(i.error?.message||void 0),l("error")):l("success")},[h,o,e]),D=(0,r.useCallback)(()=>{window.close(),setTimeout(()=>{d.push("/")},100)},[d]),F="loading"===i,C="confirm"===i,$="authorizing"===i,L="success"===i;return(0,a.FD)("div",{children:[(0,a.FD)("div",{className:F||$?"pointer-events-none":"",children:[(0,a.Y)(g,{}),(0,a.Y)(p.A,{title:"Authorize CLI Access"})]}),(0,a.Y)("main",{className:"flex items-start justify-center min-h-screen",children:(0,a.FD)(y.Z,{className:"mt-40 min-w-144",children:[(0,a.Y)(y.Z.Title,{className:"text-center",children:C?"Authorize CLI Access":L?"CLI Authorized":"Authenticating CLI"}),(0,a.FD)(y.Z.Body,{children:[F&&(0,a.FD)("div",{className:"flex justify-center mt-10",children:[(0,a.Y)(v.y,{fillCurrent:!0}),(0,a.Y)("span",{className:"ml-2",children:"Loading..."})]}),C&&(0,a.FD)("div",{className:"flex flex-col items-center mt-6",children:[(0,a.FD)("div",{className:"text-center mb-6",children:[(0,a.Y)("p",{className:"text-gray-700 mb-2",children:"The Stellate CLI is requesting access to your account."}),t?.email&&(0,a.FD)("p",{className:"text-sm text-gray-500",children:["Logged in as: ",(0,a.Y)("strong",{children:t.email})]}),(0,a.Y)("p",{className:"text-sm text-gray-500 mt-4",children:"Only authorize if you initiated this request from the CLI."})]}),(0,a.FD)("div",{className:"flex gap-4",children:[(0,a.Y)(w.$,{onClick:D,secondary:!0,children:"Deny"}),(0,a.Y)(w.$,{onClick:k,children:"Authorize"})]})]}),$&&(0,a.Y)("div",{className:"flex justify-center mt-10",children:(0,a.FD)(w.$,{loading:!0,secondary:!0,small:!0,children:[(0,a.Y)(v.y,{fillCurrent:!0})," Authorizing..."]})}),"error"===i&&(0,a.Y)("div",{className:"flex flex-col items-center mt-10",children:(0,a.FD)("div",{className:"font-medium text-red-500",children:[m??"Authorization failed",m&&(m.toLowerCase().includes("could not find login request")||m.toLowerCase().includes("login request is invalid")||m.toLowerCase().includes("already been consumed"))&&(0,a.FD)("div",{className:"mt-4 text-gray-700",children:["Please try again with",(0,a.Y)(x,{className:"ml-1",children:"stellate login"})]})]})}),!h&&!F&&(0,a.Y)("div",{className:"flex justify-center mt-10",children:(0,a.FD)("div",{className:"font-medium text-red-500",children:["Authorization code missing. Please use"," ",(0,a.Y)(x,{className:"ml-1",children:"stellate login"})," to start the authorization flow."]})}),L&&(0,a.FD)("div",{className:"flex flex-col items-center mt-6",children:[(0,a.FD)(w.$,{secondary:!0,small:!0,disabled:!0,children:["Authorized ",(0,a.Y)("span",{className:"ml-2 font-bold",children:"✅"})]}),(0,a.FD)("div",{className:"flex flex-col items-center mt-10",children:[(0,a.FD)("div",{className:"flex items-center justify-between max-w-md",children:[(0,a.Y)("div",{className:"text-md text-gray-500 font-medium mr-4",children:"You can go back to your CLI!"}),(0,a.Y)(w.$,{small:!0,onClick:()=>{window.close(),setTimeout(()=>Y(!0),100)},children:"Close Tab"})]}),N&&(0,a.Y)("div",{className:"text-sm text-gray-400 mt-4",children:"Unable to close automatically. You can close this tab manually."})]})]})]})]})})]})}},94764:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var a=i(43696);i(1224);var r=i(52875);let n=({className:e,noPadding:t=!1,noMaxWidth:i=!1,noBgColor:r=!1,noShadow:n=!1,hoverable:s=!1,...l})=>(0,a.Y)("div",{className:`rounded-12 ${e||""} ${t?"":"py-6"} ${n?"":"shadow-small"} ${i?"":"max-w-2xl"} ${r?"":"bg-white"} ${s?"hover-translate-up":""}`,...l});n.Body=({className:e,...t})=>(0,a.Y)("div",{...t,className:`px-4 sm:px-6 ${e||""}`}),n.Title=({className:e,children:t,...i})=>(0,a.Y)("div",{className:`px-4 pb-5 sm:px-6 ${e||""}`,children:(0,a.Y)(r.H2,{...i,children:t})})},99694:(e,t,i)=>{"use strict";i.d(t,{y:()=>r});var a=i(43696);function r(e){let{className:t,...i}=e;return(0,a.FD)("svg",{className:`w-5 h-5 mr-3 -ml-1 animate-spin text-gray opacity-50
6        ${t||""}`,fill:"none",viewBox:"0 0 24 24",...i,children:[(0,a.Y)("circle",{className:"opacity-25",cx:12,cy:12,r:10,stroke:"currentColor",strokeWidth:4}),(0,a.Y)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}}},e=>{e.O(0,[9562,6448,1980,636,8792],()=>e(e.s=47642)),_N_E=e.O()}]);
7//# sourceMappingURL=cli-auth-ca93a8caf4b7764e.js.map

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.