1async function createCustomerAccessToken(email,password){let storefrontToken=document.getElementById("storefront-access-token")?.value,storefrontEndpoint=document.getElementById("storefront-endpoint")?.value;if(storefrontToken||(storefrontToken=localStorage.getItem("storefrontToken")),storefrontEndpoint||(storefrontEndpoint=localStorage.getItem("storefrontEndpoint")),!storefrontToken||!storefrontEndpoint)return console.error("Token o endpoint Storefront mancante"),{success:!1,error:"Missing storefront configuration"};localStorage.setItem("storefrontToken",storefrontToken),localStorage.setItem("storefrontEndpoint",storefrontEndpoint);const query=` 2 mutation customerAccessTokenCreate($input: CustomerAccessTokenCreateInput!) { 3 customerAccessTokenCreate(input: $input) { 4 customerAccessToken { 5 accessToken 6 expiresAt 7 } 8 customerUserErrors { 9 field 10 message 11 } 12 } 13 } 14 `,variables={input:{email,password}};try{const data=(await(await fetch(storefrontEndpoint,{method:"POST",headers:{"Content-Type":"application/json","X-Shopify-Storefront-Access-Token":storefrontToken},body:JSON.stringify({query,variables})})).json())?.data?.customerAccessTokenCreate;if(data?.customerAccessToken?.accessToken){const token=data.customerAccessToken.accessToken;try{sessionStorage.setItem("customerAccessToken",token),localStorage.setItem("is-account-new","true")}catch(err){console.warn("sessionStorage unavailable, falling back to localStorage:",err),localStorage.setItem("customerAccessToken",token),localStorage.setItem("is-account-new","true")}return{success:!0,token}}return console.warn("[DEBUG] Errore nella creazione del token:",data?.customerUserErrors),{success:!1,errors:data?.customerUserErrors||[]}}catch(error){return console.error("[DEBUG] Errore nella richiesta GraphQL:",error),{success:!1,error}}}window.FGAuth={createCustomerAccessToken}; 15//# sourceMappingURL=/cdn/shop/t/75/assets/fg-customer-access-token.js.map?v=58351036129398499061769615268
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.