diff --git a/api/auth/loginOTP.php b/api/auth/loginOTP.php index ee36206..0049866 100644 --- a/api/auth/loginOTP.php +++ b/api/auth/loginOTP.php @@ -29,7 +29,7 @@ if (!$user) { $userUUID = $user['UUID'] ?? ''; if (empty(trim($userUUID))) { - $userUUID = str_replace('-', '', generateUUID()); + $userUUID = generateUUID(); queryTimed("UPDATE Users SET UUID = ? WHERE ID = ?", [$userUUID, $user['ID']]); } diff --git a/api/auth/sendOTP.php b/api/auth/sendOTP.php index 4e32326..a553578 100644 --- a/api/auth/sendOTP.php +++ b/api/auth/sendOTP.php @@ -30,14 +30,14 @@ $userUUID = ''; if ($existing) { $userUUID = $existing['UUID'] ?? ''; if (empty(trim($userUUID))) { - $userUUID = str_replace('-', '', generateUUID()); + $userUUID = generateUUID(); } queryTimed( "UPDATE Users SET MobileVerifyCode = ?, UUID = ? WHERE ID = ?", [$otp, $userUUID, $existing['ID']] ); } else { - $userUUID = str_replace('-', '', generateUUID()); + $userUUID = generateUUID(); queryTimed( "INSERT INTO Users (ContactNumber, UUID, MobileVerifyCode, IsContactVerified, IsEmailVerified, IsActive, AddedOn, Password, PromoCode) VALUES (?, ?, ?, 0, 0, 0, ?, '', ?)", diff --git a/api/auth/verifyEmailOTP.php b/api/auth/verifyEmailOTP.php index 5358cb0..e7eb627 100644 --- a/api/auth/verifyEmailOTP.php +++ b/api/auth/verifyEmailOTP.php @@ -72,7 +72,7 @@ queryTimed( jsonResponse([ 'OK' => true, 'ERROR' => '', - 'UserID' => $uid, - 'FirstName' => $user['FirstName'], - 'Token' => $token, + 'USERID' => $uid, + 'FIRSTNAME' => $user['FirstName'], + 'TOKEN' => $token, ]); diff --git a/api/helpers.php b/api/helpers.php index 830dbc8..aacab04 100644 --- a/api/helpers.php +++ b/api/helpers.php @@ -242,7 +242,7 @@ function generateUUID(): string { $bytes[6] = chr(ord($bytes[6]) & 0x0f | 0x40); // Set variant bits $bytes[8] = chr(ord($bytes[8]) & 0x3f | 0x80); - return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($bytes), 4)); + return bin2hex($bytes); } // ============================================ diff --git a/api/setup/uploadSavedPage.php b/api/setup/uploadSavedPage.php index cd2ff8a..600b1c1 100644 --- a/api/setup/uploadSavedPage.php +++ b/api/setup/uploadSavedPage.php @@ -45,7 +45,7 @@ try { } // Generate unique folder name - $uniqueId = strtolower(str_replace('-', '', generateUUID())); + $uniqueId = generateUUID(); $extractDir = "$tempBaseDir/$uniqueId"; // Validate it's a ZIP file diff --git a/api/tasks/complete.php b/api/tasks/complete.php index 82d712c..e600447 100644 --- a/api/tasks/complete.php +++ b/api/tasks/complete.php @@ -298,7 +298,7 @@ try { // Create rating records for service point tasks if ($hasServicePoint && $customerUserID > 0 && $workerUserID > 0) { // 1. Customer rates Worker - $customerToken = strtolower(str_replace('-', '', generateUUID())); + $customerToken = generateUUID(); queryTimed(" INSERT INTO TaskRatings ( TaskID, ByUserID, ForUserID, Direction, @@ -309,7 +309,7 @@ try { // 2. Worker rates Customer (if provided) if (!empty($workerRating)) { - $workerToken = strtolower(str_replace('-', '', generateUUID())); + $workerToken = generateUUID(); queryTimed(" INSERT INTO TaskRatings ( TaskID, ByUserID, ForUserID, Direction,