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:
parent
8921b55c57
commit
a7138ba958
1 changed files with 2 additions and 1 deletions
|
|
@ -45,7 +45,8 @@ function generateOTP() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
data = readJsonBody();
|
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) {
|
if (len(phone) != 10) {
|
||||||
apiAbort({ "OK": false, "ERROR": "invalid_phone", "MESSAGE": "Please enter a valid 10-digit phone number" });
|
apiAbort({ "OK": false, "ERROR": "invalid_phone", "MESSAGE": "Please enter a valid 10-digit phone number" });
|
||||||
|
|
|
||||||
Reference in a new issue