diff --git a/app/Controllers/RestAuthenticationController.php b/app/Controllers/RestAuthenticationController.php index a33cff95..bed2e473 100755 --- a/app/Controllers/RestAuthenticationController.php +++ b/app/Controllers/RestAuthenticationController.php @@ -94,9 +94,16 @@ class RestAuthenticationController extends AdminController { try { $mobile_number = $this->request->getJSON()->mobile_number; - $otp_verification = $this->request->getJSON()->otp; + $otp_verification = $this->request->getJSON()->otp_verification; - $employeeData = $this->employeeModel->where('mobile', $mobile_number)->where('relationship', 'self')->first(); + if (isset($this->request->getJSON()->login_by_hr)) + { + $employeeData = $this->employeeModel->where('id', $this->request->getJSON()->employee_id)->where('relationship', 'self')->first(); + }else{ + $employeeData = $this->employeeModel->where('mobile', $mobile_number)->where('relationship', 'self')->first(); + } + + if ($employeeData && $otp_verification == true || $employeeData && isset($this->request->getJSON()->login_by_hr)) { $auth = HttpRequestHelper::getRequestInfo();