From 8e3bb681e76d6789863e6ef4611813ef599abdf8 Mon Sep 17 00:00:00 2001 From: John Mizerek Date: Mon, 26 Jan 2026 11:49:44 -0800 Subject: [PATCH] Add OTP-based signup page for website onboarding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - New portal/signup.html with phone → OTP → profile flow - Handle both new users (signup) and existing users (login) - Auto-detect user type and use appropriate API endpoints - Show DEV_OTP on page for local testing - Updated sendOTP.cfm to gracefully handle missing Twilio Co-Authored-By: Claude Opus 4.5 --- api/auth/sendOTP.cfm | 25 +- portal/signup.html | 834 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 851 insertions(+), 8 deletions(-) create mode 100644 portal/signup.html diff --git a/api/auth/sendOTP.cfm b/api/auth/sendOTP.cfm index 871800a..c059c7f 100644 --- a/api/auth/sendOTP.cfm +++ b/api/auth/sendOTP.cfm @@ -130,19 +130,28 @@ try { }, { datasource: "payfrit" }); } - // Send OTP via Twilio - smsResult = application.twilioObj.sendSMS( - recipientNumber: "+1" & phone, - messageBody: "Your Payfrit verification code is: " & otp - ); + // Send OTP via Twilio (if available) + smsMessage = "Code saved (SMS skipped in dev)"; + devOTP = otp; // Return OTP in dev mode for testing - smsStatus = smsResult.success ? "sent" : "failed: " & smsResult.message; + if (structKeyExists(application, "twilioObj")) { + try { + smsResult = application.twilioObj.sendSMS( + recipientNumber: "+1" & phone, + messageBody: "Your Payfrit verification code is: " & otp + ); + smsMessage = smsResult.success ? "Verification code sent" : "SMS failed - please try again"; + if (smsResult.success) devOTP = ""; // Don't leak OTP in production + } catch (any smsErr) { + smsMessage = "SMS error: " & smsErr.message; + } + } writeOutput(serializeJSON({ "OK": true, "UUID": userUUID, - "MESSAGE": smsResult.success ? "Verification code sent" : "SMS failed but code created - contact support", - "SMS_STATUS": smsStatus + "MESSAGE": smsMessage, + "DEV_OTP": devOTP })); } catch (any e) { diff --git a/portal/signup.html b/portal/signup.html new file mode 100644 index 0000000..8da0902 --- /dev/null +++ b/portal/signup.html @@ -0,0 +1,834 @@ + + + + + + Get Started - Payfrit + + + + + + + + +