From ccdb791733472169c1efc0e3960dfffab033130f Mon Sep 17 00:00:00 2001 From: Gowtham M Date: Mon, 12 Jan 2026 12:36:12 +0530 Subject: [PATCH] Mpin api message --- app/Controllers/RestAuthenticationController.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/Controllers/RestAuthenticationController.php b/app/Controllers/RestAuthenticationController.php index 50dbd80f..3f23f944 100755 --- a/app/Controllers/RestAuthenticationController.php +++ b/app/Controllers/RestAuthenticationController.php @@ -944,6 +944,12 @@ class RestAuthenticationController extends AdminController $mpin = $this->request->getJSON()->new_mpin; $client_id = $this->request->getJSON()->client_id ?? null; + if($old_mpin == $mpin) + { + $result = ['mpin_verification' => false , 'message' => "New MPIN must be different from the old MPIN"]; + return $this->respond(['status' => 'failed','code' => 404,'data' => $result],200); + } + // if (isset($mobile_number)) // { // $employeeData = $this->employeeModel->where('mobile', $mobile_number)->where('mpin', $old_mpin)->where('relationship', 'self')->first(); @@ -1015,11 +1021,11 @@ class RestAuthenticationController extends AdminController } else { - $this->myLogger->logme("error", "REST-AUTH-CONTROLLER - updateMpin: Employee not found in the POST. Wrong MPIN"); + $this->myLogger->logme("error", "REST-AUTH-CONTROLLER - updateMpin: Employee not found in the POST. Old MPIN is incorrect"); log_message('error', ' '); log_message('error', ' ************************************* POST END **************************************** '); log_message('error', ' '); - $result = ['mpin_verification' => false , 'message' => "Wrong Mpin"]; + $result = ['mpin_verification' => false , 'message' => "Old MPIN is incorrect"]; return $this->respond(['status' => 'failed','code' => 404,'data' => $result],200); }