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:
parent
dbd46cc157
commit
90acc35792
1 changed files with 5 additions and 6 deletions
|
|
@ -88,12 +88,11 @@ export default defineEventHandler(async (event) => {
|
||||||
member
|
member
|
||||||
})
|
})
|
||||||
|
|
||||||
// Paid-tier signups need to complete Helcim checkout in the same tab
|
// Signup completes (paid checkout or free activation) before the magic
|
||||||
// before the magic link can be clicked. Issue a short-lived, payment-only
|
// link is clicked, so issue a short-lived, payment-only bridge cookie
|
||||||
// bridge cookie so /api/helcim/initialize-payment accepts the request.
|
// that lets /api/helcim/initialize-payment and /api/helcim/subscription
|
||||||
if (body.contributionAmount > 0) {
|
// identify the member without a verified auth session.
|
||||||
setPaymentBridgeCookie(event, member)
|
setPaymentBridgeCookie(event, member)
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue