PageSourceSearch

https://generate-shopify-admin-access-token.vercel.app/_next/static/chunks/ab613fdda791407f.js

js generate-shopify-admin-access-token.vercel.app collected 2026-10-03 06:59:46 UTC 4,600 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,31713,e=>{"use strict";var t=e.i(43476),i=e.i(71645);function n(){let[e,n]=(0,i.useState)({shopifyUrl:"",appClientId:"",appClientSecret:""}),[s,o]=(0,i.useState)(()=>window.sessionStorage.getItem("shopifyUrl")??""),[r,l]=(0,i.useState)(()=>window.sessionStorage.getItem("appClientId")??""),[a,p]=(0,i.useState)(()=>window.sessionStorage.getItem("appClientSecret")??""),[c,d]=(0,i.useState)(""),[m,h]=(0,i.useState)(()=>{let e=new URLSearchParams(window.location.search).get("code");return e?(window.sessionStorage.setItem("authCode",e),e):window.sessionStorage.getItem("authCode")??""});(0,i.useEffect)(()=>{(async()=>{if(m){window.sessionStorage.setItem("authCode",m);let e=s.trim().replace(/\/$/,""),t=new URLSearchParams({clientid:r.trim(),clientsecret:a.trim(),code:m});t.set("shopifyurl",e);let i=await fetch(`/api/access-token?${t.toString()}`,{method:"POST"});d(JSON.stringify(await i.json(),null,2)),o(""),l(""),p(""),h(""),window.sessionStorage.removeItem("shopifyUrl"),window.sessionStorage.removeItem("appClientId"),window.sessionStorage.removeItem("appClientSecret"),window.sessionStorage.removeItem("authCode"),window.history.replaceState(null,"",window.location.pathname)}})()},[m,s,r,a]);let u=async e=>{e.preventDefault();let t=s.trim().replace(/\/$/,""),i=r.trim(),o=a.trim();if(!((e,t,i)=>{let s={shopifyUrl:"",appClientId:"",appClientSecret:""};if(e)try{let t=new URL(e);"https:"!==t.protocol&&(s.shopifyUrl="Shopify URL must start with https://.")}catch{s.shopifyUrl="Enter a valid Shopify URL."}else s.shopifyUrl="Shopify URL is required.";return t||(s.appClientId="App Client ID is required."),i||(s.appClientSecret="App Client Secret is required."),n(s),!s.shopifyUrl&&!s.appClientId&&!s.appClientSecret})(t,i,o))return;let l=`${window.location.origin}${window.location.pathname}`;if(!m){window.sessionStorage.setItem("shopifyUrl",t),window.sessionStorage.setItem("appClientId",i),window.sessionStorage.setItem("appClientSecret",o);let e=`${t}/admin/oauth/authorize?client_id=${encodeURIComponent(i)}&redirect_uri=${encodeURIComponent(l)}`;window.location.assign(e);return}};return(0,t.jsx)("div",{className:"min-h-screen bg-zinc-50 px-4 py-12",children:(0,t.jsxs)("main",{className:"mx-auto w-full max-w-4xl rounded-xl border border-zinc-200 bg-white p-6 shadow-sm sm:p-8",children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold text-zinc-900",children:"Generate Shopify Authorize URL"}),(0,t.jsxs)("form",{onSubmit:u,className:"mt-6 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"shopify-url",className:"mb-2 block text-sm font-medium text-zinc-700",children:"Shopify URL"}),(0,t.jsx)("input",{id:"shopify-url",type:"text",placeholder:"https://your-store.myshopify.com",value:s,onChange:e=>{o(e.target.value),n(e=>({...e,shopifyUrl:""}))},className:"w-full rounded-md border border-zinc-300 px-3 py-2 text-sm text-zinc-900 outline-none transition focus:border-zinc-500"}),e.shopifyUrl&&(0,t.jsx)("p",{className:"mt-1 text-sm text-red-600",children:e.shopifyUrl})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"app-client-id",className:"mb-2 block text-sm font-medium text-zinc-700",children:"App Client ID"}),(0,t.jsx)("input",{id:"app-client-id",type:"text",placeholder:"Enter app client ID",value:r,onChange:e=>{l(e.target.value),n(e=>({...e,appClientId:""}))},className:"w-full rounded-md border border-zinc-300 px-3 py-2 text-sm text-zinc-900 outline-none transition focus:border-zinc-500"}),e.appClientId&&(0,t.jsx)("p",{className:"mt-1 text-sm text-red-600",children:e.appClientId})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"app-client-secret",className:"mb-2 block text-sm font-medium text-zinc-700",children:"App Client Secret"}),(0,t.jsx)("input",{id:"app-client-secret",type:"text",placeholder:"Enter app client secret",value:a,onChange:e=>{p(e.target.value),n(e=>({...e,appClientSecret:""}))},className:"w-full rounded-md border border-zinc-300 px-3 py-2 text-sm text-zinc-900 outline-none transition focus:border-zinc-500"}),e.appClientSecret&&(0,t.jsx)("p",{className:"mt-1 text-sm text-red-600",children:e.appClientSecret})]}),(0,t.jsx)("button",{type:"submit",className:"w-full rounded-md bg-zinc-900 px-6 py-3 text-base font-medium text-white transition hover:bg-zinc-700",children:"Create Access Token"})]}),c&&(0,t.jsx)("pre",{className:"mt-6 overflow-x-auto rounded-md bg-zinc-100 p-3 text-sm text-zinc-800",children:(0,t.jsx)("code",{children:c})})]})})}e.s(["default",()=>n])}]);

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.