diff --git a/app/Config/Routes.php b/app/Config/Routes.php index d5cc961..7cdb968 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -3,6 +3,14 @@ use CodeIgniter\Router\RouteCollection; + +// Allow OPTIONS for all routes +$routes->options('(:any)', function() { + // This will never be called because the CORS filter returns early + // But having this route ensures OPTIONS isn't rejected as 404 +}); + + /** * @var RouteCollection $routes */ diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index 5517945..a5bb992 100755 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -2290,7 +2290,7 @@ class EmployeeRestController extends AdminController $empData = $this->employeeModel->where('emp_code', $emp_code )->where('client_id', $client_id ) ->where('is_active', 1 )->findAll(); $employeeIds = array_column($empData, 'id'); //for mail common parameter - $filteredEmpData = array_filter($empData, fn($item) => $item['relationship'] === 'Self'); + $filteredEmpData = array_values(array_filter($empData, fn($item) => $item['relationship'] === 'Self')); if (!is_null($client_policy_id) && is_array($client_policy_id)) { diff --git a/app/Controllers/RestAuthenticationController.php b/app/Controllers/RestAuthenticationController.php index 69d9e5e..7531d2e 100755 --- a/app/Controllers/RestAuthenticationController.php +++ b/app/Controllers/RestAuthenticationController.php @@ -390,6 +390,14 @@ class RestAuthenticationController extends AdminController $email_id = isset($this->request->getJSON()->email_id) ? $this->request->getJSON()->email_id : null; $otp = isset($this->request->getJSON()->otp) ? $this->request->getJSON()->otp : null; + if(empty($otp)){ + return $this->respond(['status' => 'OTP is required','code' => 400,'message' => 'OTP is required'], 200); + } + + if (empty($mobile_number) && empty($email_id)) { + return $this->respond(['status' => 'failed','code' => 400,'message' => 'Mobile number or Email ID is required'], 200); + } + $this->myLogger->logme("error", "REST-AUTH-CONTROLLER - getVerifiedUserData: Fetching empdata via RestAuthHelper"); $empdata = RestAuthHelper::getPreAndPostDataByEmailOrMobile(['email_id' => $email_id, 'otp' => $otp, 'mobile_number' => $mobile_number ]); diff --git a/app/Views/client_policy.php b/app/Views/client_policy.php index fe028ca..b2f4917 100755 --- a/app/Views/client_policy.php +++ b/app/Views/client_policy.php @@ -60,8 +60,71 @@ #table-client-policy_filter{ text-align: left; } - + + + +
@@ -227,7 +290,7 @@ required>
-
+ +
+
@@ -261,15 +333,26 @@
- -
+ +
+ +
+ + -
+ + +
+ +
+
+ +