fix: free tier shows payment form only after account created (auth-badge reveal)
Deploy marketing to Cloud Run / deploy (push) Has been cancelled

This commit is contained in:
Will Anderson
2026-05-02 18:48:38 -05:00
parent 6702fb7f9a
commit 88ee3d53de
+19 -1
View File
@@ -136,7 +136,7 @@ fn checkout_page(plan: String, pub_key: String) -> String {
</div>
<!-- Payment form (visible immediately - no auth wall) -->
<div id=\"payment-section\">
<div id=\"payment-section\" " + (if is_free { "style=\"display:none;\"" } else { "" }) + ">
<div id=\"auth-badge\" style=\"display:none; margin-bottom: 1.5rem;\"></div>
" + (if is_free { "" } else { "
<p class=\"checkout-auth-hint\" id=\"signin-prompt\" style=\"margin-bottom:1.25rem;font-size:.8125rem\">Already have an account? <a href=\"#\" onclick=\"document.getElementById('auth-section').style.display='';this.parentNode.style.display='none';return false;\" style=\"color:var(--navy);text-decoration:underline\">Sign in</a> to link your purchase.</p>
@@ -488,5 +488,23 @@ fn checkout_page(plan: String, pub_key: String) -> String {
<script src=\"/assets/js/db455e1671dd.js\" defer></script>
<script>window.NEURON_CFG=window.NEURON_CFG||{};window.NEURON_CFG.plan=\"" + plan + "\";window.NEURON_CFG.pub_key=\"" + pub_key + "\";</script><script src=\"/assets/js/e708dcbb3e7a.js\" defer></script>
" + (if is_free { "
<script>
(function(){
// Free tier: reveal payment section only after the user has created / signed in.
// The existing checkout JS sets auth-badge visible on successful auth — watch for that.
var pay = document.getElementById('payment-section');
if (!pay) return;
var timer = setInterval(function(){
var badge = document.getElementById('auth-badge');
if (badge && badge.offsetParent !== null) {
pay.style.display = '';
clearInterval(timer);
}
}, 150);
})();
</script>
" } else { "" }) + "
"
}