1class ShopifySession { 2 constructor() { 3 this.createEndpoint = 'https://my.drharveys.com/shopify/session/update'; 4 this.csrfToken = 'A0gnmJnY9Fm5WJWWYR-BrI38GQsx1iBoc-aPcBBDoFvkex8O5-BWDT1c8BQ4ic70rjxujM-Y0-fh08usChdN8w'; 5 this.initialize(); 6 } 7 8 initialize() { 9 console.log('ShopifySession initialized'); 10 this.createSession(); 11 } 12 13 getUrlParams() { 14 const searchParams = new URLSearchParams(window.location.search); 15 const params = {}; 16 for (const [key, value] of searchParams.entries()) { 17 params[key] = value; 18 } 19 return params; 20 } 21 22 createSession() { 23 const params = this.getUrlParams(); 24 25 fetch(this.createEndpoint, { 26 method: 'POST', 27 credentials: 'include', // Important for CORS with credentials 28 headers: { 29 'Content-Type': 'application/json', 30 'X-CSRF-Token': this.csrfToken 31 }, 32 body: JSON.stringify(params) 33 }) 34 .then(response => { 35 if (!response.ok) { 36 throw new Error('Network response was not ok'); 37 } 38 console.log('Session created successfully'); 39 }) 40 .catch(error => { 41 console.error('Error creating session:', error); 42 }); 43 } 44 45} 46 47// Initialize the class 48window.shopifySession = new ShopifySession();
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.