Fix loginOTP case sensitivity with preserveCaseForStructKey

The beacon app sends "Phone" (uppercase) but loginOTP.cfm checked for
"phone" (lowercase). With preserveCaseForStructKey=true this fails.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
John Mizerek 2026-03-07 16:12:03 -08:00
parent 8921b55c57
commit a7138ba958

View file

@ -45,7 +45,8 @@ function generateOTP() {
try {
data = readJsonBody();
phone = structKeyExists(data, "phone") ? normalizePhone(data.phone) : "";
phone = structKeyExists(data, "Phone") ? normalizePhone(data.Phone)
: structKeyExists(data, "phone") ? normalizePhone(data.phone) : "";
if (len(phone) != 10) {
apiAbort({ "OK": false, "ERROR": "invalid_phone", "MESSAGE": "Please enter a valid 10-digit phone number" });