Fix UserID column references in auth endpoints after schema normalization
Users table primary key was renamed from UserID to ID but these endpoints still referenced the old column name, causing server_error on login/signup OTP flow. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
bffca643b5
commit
bc88f28e60
6 changed files with 8 additions and 8 deletions
|
|
@ -100,7 +100,7 @@ try {
|
|||
IsEmailVerified = 0,
|
||||
IsContactVerified = 1,
|
||||
IsActive = 1
|
||||
WHERE UserID = :userId
|
||||
WHERE ID = :userId
|
||||
", {
|
||||
firstName: { value: firstName, cfsqltype: "cf_sql_varchar" },
|
||||
lastName: { value: lastName, cfsqltype: "cf_sql_varchar" },
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ try {
|
|||
if (!len(trim(userUUID))) {
|
||||
userUUID = replace(createUUID(), "-", "", "all");
|
||||
queryExecute("
|
||||
UPDATE Users SET UUID = :uuid WHERE UserID = :userId
|
||||
UPDATE Users SET UUID = :uuid WHERE ID = :userId
|
||||
", {
|
||||
uuid: { value: userUUID, cfsqltype: "cf_sql_varchar" },
|
||||
userId: { value: qUser.ID, cfsqltype: "cf_sql_integer" }
|
||||
|
|
@ -81,7 +81,7 @@ try {
|
|||
queryExecute("
|
||||
UPDATE Users
|
||||
SET MobileVerifyCode = :otp
|
||||
WHERE UserID = :userId
|
||||
WHERE ID = :userId
|
||||
", {
|
||||
otp: { value: otp, cfsqltype: "cf_sql_varchar" },
|
||||
userId: { value: qUser.ID, cfsqltype: "cf_sql_integer" }
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ if (cgi.REQUEST_METHOD == "POST") {
|
|||
queryExecute("
|
||||
UPDATE Users
|
||||
SET #arrayToList(updates, ', ')#
|
||||
WHERE UserID = :userId
|
||||
WHERE ID = :userId
|
||||
", params);
|
||||
|
||||
// Return updated profile
|
||||
|
|
|
|||
|
|
@ -91,10 +91,10 @@ try {
|
|||
SET MobileVerifyCode = :otp,
|
||||
IsContactVerified = 0,
|
||||
IsActive = 0
|
||||
WHERE UserID = :userId
|
||||
WHERE ID = :userId
|
||||
", {
|
||||
otp: { value: otp, cfsqltype: "cf_sql_varchar" },
|
||||
userId: { value: qIncomplete.UserID, cfsqltype: "cf_sql_integer" }
|
||||
userId: { value: qIncomplete.ID, cfsqltype: "cf_sql_integer" }
|
||||
}, { datasource: "payfrit" });
|
||||
} else {
|
||||
// Create new user record
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ try {
|
|||
queryExecute("
|
||||
UPDATE Users
|
||||
SET MobileVerifyCode = ''
|
||||
WHERE UserID = :userId
|
||||
WHERE ID = :userId
|
||||
", { userId: { value: qUser.ID, cfsqltype: "cf_sql_integer" } }, { datasource: "payfrit" });
|
||||
|
||||
// Create auth token
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ try {
|
|||
queryExecute("
|
||||
UPDATE Users
|
||||
SET MobileVerifyCode = ''
|
||||
WHERE UserID = :userId
|
||||
WHERE ID = :userId
|
||||
", { userId: { value: qUser.ID, cfsqltype: "cf_sql_integer" } }, { datasource: "payfrit" });
|
||||
|
||||
// Create auth token (needed for completeProfile call)
|
||||
|
|
|
|||
Reference in a new issue