fix(public): do not expose coupon code after preregistration
Codes are still created and stored for Mailwizz; JSON response omits coupon_code. Thank-you UI explains email delivery instead of showing code. Made-with: Cursor
This commit is contained in:
@@ -420,7 +420,6 @@ document.addEventListener('alpine:init', () => {
|
||||
redirectSecondsLeft: null,
|
||||
redirectTimer: null,
|
||||
strings: config.strings || {},
|
||||
couponCode: '',
|
||||
|
||||
copyPageLink() {
|
||||
const url = this.pageShareUrl;
|
||||
@@ -435,19 +434,6 @@ document.addEventListener('alpine:init', () => {
|
||||
});
|
||||
},
|
||||
|
||||
copyCouponCode() {
|
||||
const code = this.couponCode;
|
||||
if (!code) {
|
||||
return;
|
||||
}
|
||||
navigator.clipboard.writeText(code).then(() => {
|
||||
this.copyFeedback = this.strings?.couponCopied || '';
|
||||
setTimeout(() => {
|
||||
this.copyFeedback = '';
|
||||
}, 2500);
|
||||
});
|
||||
},
|
||||
|
||||
init() {
|
||||
if (this.phase === 'before') {
|
||||
this.tickCountdown();
|
||||
@@ -566,8 +552,6 @@ document.addEventListener('alpine:init', () => {
|
||||
if (res.ok && data.success) {
|
||||
this.phase = 'thanks';
|
||||
this.thankYouMessage = data.message ?? '';
|
||||
this.couponCode =
|
||||
typeof data.coupon_code === 'string' && data.coupon_code !== '' ? data.coupon_code : '';
|
||||
this.startRedirectCountdownIfNeeded();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user