diff --git a/app/Controllers/RestAuthenticationController.php b/app/Controllers/RestAuthenticationController.php index 23b8891..1465f4b 100755 --- a/app/Controllers/RestAuthenticationController.php +++ b/app/Controllers/RestAuthenticationController.php @@ -563,6 +563,7 @@ class RestAuthenticationController extends AdminController ->first(); $otp = random_int(100000, 999999); + $data->otp = $otp; if ($HrData) { @@ -609,11 +610,9 @@ class RestAuthenticationController extends AdminController } else { // Call the third-party API function - $reqData = $this->request->getJSON(); - $reqData->otp = $otp; - return $this->callThirdPartyAPI($this->request->getJSON(),'verifyHrWithEmail'); - + return $this->callThirdPartyAPI($data,'verifyHrWithEmail'); } + } catch (\Throwable $th) { return $this->respond(['status' => 'failed','code' => 500,'data' => $th],500); } @@ -659,6 +658,7 @@ class RestAuthenticationController extends AdminController ->join('clients', 'client_branch.client_id = clients.id', 'left') ->where('level_contacts.mobile', $mobile_number ) ->where('level_contacts.contact_type', 'client') + ->where('is_active', 1) ->findAll(); //set otp value null $this->hrModel->where('mobile', $mobile_number)->where('otp', $otp)->where('contact_type', 'client')->set(['otp'=>null])->update(); @@ -670,6 +670,7 @@ class RestAuthenticationController extends AdminController ->join('clients', 'client_branch.client_id = clients.id', 'left') ->where('level_contacts.email', $email ) ->where('level_contacts.contact_type', 'client') + ->where('is_active', 1) ->findAll(); //set otp value null $this->hrModel->where('email', $email)->where('otp', $otp)->where('contact_type', 'client')->set(['otp'=>null])->update();