@@ -804,7 +804,7 @@ ${SUPPORTED_LANGS.map(l => ` <link rel="alternate" hreflang="${l}" href="${base
804804
805805 function doSubscribe(tier, interval) {
806806 var body = { tier: tier, interval: interval };
807- ${ refCode ? `body.referral_code = ${ JSON . stringify ( refCode ) } ;` : "" }
807+ ${ refCode ? `body.referral_code = ${ JSON . stringify ( refCode ) . replace ( / < / g , "\\u003c" ) } ;` : "" }
808808 fetch('/subscribe', {
809809 method: 'POST',
810810 headers: { 'Content-Type': 'application/json' },
@@ -920,7 +920,7 @@ ${betaBannerJS()}
920920 } catch ( err ) {
921921 const msg = err instanceof Error ? err . message : String ( err ) ;
922922 console . error ( "Subscribe error:" , msg ) ;
923- res . status ( 500 ) . json ( { error : msg } ) ;
923+ res . status ( 500 ) . json ( { error : "An internal error occurred. Please try again." } ) ;
924924 }
925925 } ) ;
926926
@@ -996,7 +996,7 @@ ${betaBannerJS()}
996996 } catch ( err ) {
997997 const msg = err instanceof Error ? err . message : String ( err ) ;
998998 console . error ( "Subscribe-org error:" , msg ) ;
999- res . status ( 500 ) . json ( { error : msg } ) ;
999+ res . status ( 500 ) . json ( { error : "An internal error occurred. Please try again." } ) ;
10001000 }
10011001 } ) ;
10021002
@@ -1038,7 +1038,8 @@ ${betaBannerJS()}
10381038 res . json ( { ok : true , publicity_opt_in : ! ! opt_in } ) ;
10391039 } catch ( err ) {
10401040 const msg = err instanceof Error ? err . message : String ( err ) ;
1041- res . status ( 500 ) . json ( { error : msg } ) ;
1041+ console . error ( "Org publicity error:" , msg ) ;
1042+ res . status ( 500 ) . json ( { error : "An internal error occurred. Please try again." } ) ;
10421043 }
10431044 } ) ;
10441045
@@ -1093,7 +1094,7 @@ ${betaBannerJS()}
10931094 } catch ( err ) {
10941095 const msg = err instanceof Error ? err . message : String ( err ) ;
10951096 console . error ( "Checkout error:" , msg ) ;
1096- res . status ( 500 ) . json ( { error : msg } ) ;
1097+ res . status ( 500 ) . json ( { error : "An internal error occurred. Please try again." } ) ;
10971098 }
10981099 } ) ;
10991100
@@ -1165,7 +1166,7 @@ ${betaBannerJS()}
11651166 } catch ( err ) {
11661167 const msg = err instanceof Error ? err . message : String ( err ) ;
11671168 console . error ( "Boost checkout error:" , msg ) ;
1168- res . status ( 500 ) . json ( { error : msg } ) ;
1169+ res . status ( 500 ) . json ( { error : "An internal error occurred. Please try again." } ) ;
11691170 }
11701171 } ) ;
11711172
@@ -1217,7 +1218,7 @@ ${betaBannerJS()}
12171218 let user = email ? getUserByEmail ( db , email ) : undefined ;
12181219 if ( ! user ) {
12191220 user = createUser ( db , email , stripeCustomerId ) ;
1220- console . log ( `New user created: ${ user . api_key } (${ email } )` ) ;
1221+ console . log ( `New user created: ${ user . api_key . slice ( 0 , 12 ) } ... (${ email } )` ) ;
12211222 }
12221223
12231224 // Extract billing interval from the Stripe subscription (if subscription mode)
@@ -1424,7 +1425,7 @@ export REGEN_BALANCE_URL=${baseUrl}</pre>
14241425 <div class="regen-card__body">
14251426 <h2 style="color:var(--regen-navy);margin:0 0 8px;font-size:18px;font-weight:700;">Share your commitment?</h2>
14261427 <p style="color:var(--regen-gray-700);font-size:14px;margin:0 0 14px;line-height:1.6;">
1427- Would you like us to feature <strong>${ org . name . replace ( / < / g , "<" ) } </strong> on our website and social media as an organization committed to regenerative AI? This helps inspire others to follow your lead.
1428+ Would you like us to feature <strong>${ escapeHtml ( org . name ) } </strong> on our website and social media as an organization committed to regenerative AI? This helps inspire others to follow your lead.
14281429 </p>
14291430 <div id="publicity-prompt" style="display:flex;gap:10px;align-items:center;">
14301431 <button onclick="setPublicity(true)" class="regen-btn regen-btn--solid regen-btn--sm">Yes, share it</button>
@@ -1438,12 +1439,12 @@ export REGEN_BALANCE_URL=${baseUrl}</pre>
14381439 fetch('/org/publicity', {
14391440 method: 'POST',
14401441 headers: { 'Content-Type': 'application/json' },
1441- body: JSON.stringify({ org_id: ${ org . id } , opt_in: optIn, session_id: ' ${ sessionId } ' })
1442+ body: JSON.stringify({ org_id: ${ org . id } , opt_in: optIn, session_id: ${ JSON . stringify ( sessionId ) . replace ( / < / g , "\\u003c" ) } })
14421443 }).then(function(r) { return r.json(); }).then(function(data) {
14431444 document.getElementById('publicity-prompt').style.display = 'none';
14441445 var saved = document.getElementById('publicity-saved');
14451446 saved.style.display = 'block';
1446- saved.textContent = optIn ? 'Thank you! We\\'ll feature ${ org . name . replace ( / ' / g, "\\' " ) } on our site.' : 'No problem — you can change this anytime from your dashboard.';
1447+ saved.textContent = optIn ? 'Thank you! We\\'ll feature ' + ${ JSON . stringify ( org . name ) . replace ( / < / g, "\\u003c " ) } + ' on our site.' : 'No problem — you can change this anytime from your dashboard.';
14471448 });
14481449 }
14491450 </script>
@@ -1495,7 +1496,7 @@ export REGEN_BALANCE_URL=${baseUrl}</pre>
14951496 fetch('/profile/display-name', {
14961497 method: 'POST',
14971498 headers: { 'Content-Type': 'application/json' },
1498- body: JSON.stringify({ session_id: ' ${ sessionId } ' , display_name: name })
1499+ body: JSON.stringify({ session_id: ${ JSON . stringify ( sessionId ) . replace ( / < / g , "\\u003c" ) } , display_name: name })
14991500 }).then(function(r) { return r.json(); }).then(function(data) {
15001501 if (data.ok) {
15011502 document.getElementById('profilePrompt').style.display = 'none';
@@ -1523,7 +1524,7 @@ export REGEN_BALANCE_URL=${baseUrl}</pre>
15231524 fetch('/profile/display-name', {
15241525 method: 'POST',
15251526 headers: { 'Content-Type': 'application/json' },
1526- body: JSON.stringify({ session_id: ' ${ sessionId } ' , display_name: 'My On-Chain Proof' })
1527+ body: JSON.stringify({ session_id: ${ JSON . stringify ( sessionId ) . replace ( / < / g , "\\u003c" ) } , display_name: 'My On-Chain Proof' })
15271528 }).catch(function() {});
15281529 }
15291530 </script>
@@ -1956,7 +1957,7 @@ async function handleSubscriptionCreated(db: Database.Database, sub: Stripe.Subs
19561957 let user = email ? getUserByEmail ( db , email ) : undefined ;
19571958 if ( ! user ) {
19581959 user = createUser ( db , email , customerId ?? null ) ;
1959- console . log ( `New user created for subscription: ${ user . api_key } (${ email } )` ) ;
1960+ console . log ( `New user created for subscription: ${ user . api_key . slice ( 0 , 12 ) } ... (${ email } )` ) ;
19601961 }
19611962
19621963 const priceItem = sub . items ?. data ?. [ 0 ] ?. price ;
0 commit comments