From c348d35c7ecb6c74f71cf90b982412f267c5d807 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Tue, 10 Feb 2026 02:19:05 +0000
Subject: [PATCH] =minor fixes to schema system

---
 assets/js/concise/Referral.js |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/assets/js/concise/Referral.js b/assets/js/concise/Referral.js
index 74e4d48..14fa979 100644
--- a/assets/js/concise/Referral.js
+++ b/assets/js/concise/Referral.js
@@ -35,7 +35,7 @@
 		};
 
 		this.forms = this.container.querySelectorAll('form');
-		this.popup = new window.jvbPopup({
+		this.popup = window.jvbPopup.registerPopup({
 			toggle: this.toggle,
 			popup: this.container,
 			name: 'Referral Box',
@@ -640,8 +640,9 @@
 					referral_code: formData.get('referral_code')
 				};
 
-				if (formData.get('cf-turnstile-response')) {
-					data['cf-turnstile-response'] = formData.get('cf-turnstile-response');
+				const turnstileInput = form.querySelector('input[name="cf-turnstile-response"]');
+				if (turnstileInput && turnstileInput.value) {
+					data['cf-turnstile-response'] = turnstileInput.value;
 				}
 
 				if (!data.name || !data.email || !data.referral_code) {
@@ -652,15 +653,16 @@
 			} else if (form.id === 'login-form') {
 				let data = {
 					type: 'login',
-					email: formData.get('login_email'),
+					user_email: formData.get('login_email'),
 					context: {
 						redirect_to: window.location.href + '?seeReferral=1'
 					}
 				};
-				if (formData.get('cf-turnstile-response')) {
-					data['cf-turnstile-response'] = formData.get('cf-turnstile-response');
+				const turnstileInput = form.querySelector('input[name="cf-turnstile-response"]');
+				if (turnstileInput && turnstileInput.value) {
+					data['cf-turnstile-response'] = turnstileInput.value;
 				}
-				if (!data.email) {
+				if (!data['user_email']) {
 					result.message = 'Please fill in your email';
 				} else {
 					result = await this.makeRequest('auth/magic', data);

--
Gitblit v1.10.0