fix(helcim): always issue payment-bridge cookie on signup

Free ($0) signups need the same short-lived bridge cookie as paid signups
so /api/helcim/subscription can identify the member during activation
without a verified auth session. Drops the contributionAmount > 0 guard
that broke free-tier activation in the same flow.
This commit is contained in:
Jennie Robinson Faber 2026-04-29 21:00:22 +01:00
parent dbd46cc157
commit 90acc35792

View file

@ -88,12 +88,11 @@ export default defineEventHandler(async (event) => {
member
})
// Paid-tier signups need to complete Helcim checkout in the same tab
// before the magic link can be clicked. Issue a short-lived, payment-only
// bridge cookie so /api/helcim/initialize-payment accepts the request.
if (body.contributionAmount > 0) {
setPaymentBridgeCookie(event, member)
}
// Signup completes (paid checkout or free activation) before the magic
// link is clicked, so issue a short-lived, payment-only bridge cookie
// that lets /api/helcim/initialize-payment and /api/helcim/subscription
// identify the member without a verified auth session.
setPaymentBridgeCookie(event, member)
return {
success: true,