GWM : token string cleared in auth api key
This commit is contained in:
parent
49e61063f4
commit
5447bcddeb
@ -625,7 +625,7 @@ class RestAuthenticationController extends AdminController
|
||||
|
||||
public function getVerifiedHrData()
|
||||
{
|
||||
try {
|
||||
// try {
|
||||
// mobile number
|
||||
$otp_verification = isset($this->request->getJSON()->otp_verification) ? $this->request->getJSON()->otp_verification : null;
|
||||
$mobile_number = isset($this->request->getJSON()->mobile_no) ? $this->request->getJSON()->mobile_no : null;
|
||||
@ -656,27 +656,30 @@ class RestAuthenticationController extends AdminController
|
||||
$this->authHistoryModel->insert($data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(isset($this->request->getJSON()->mobile_no)){
|
||||
|
||||
$hrData = $this->hrModel ->select('level_contacts.* , client_branch.client_id as client_id')
|
||||
$getAllhrData = $this->hrModel->select('level_contacts.mobile , level_contacts.email , clients.id as client_id, clients.client_name, clients.short_name , client_branch.id as client_branch_id,client_branch.branch_name')
|
||||
->join('client_branch', 'level_contacts.ref_id = client_branch.id', 'left')
|
||||
->join('clients', 'client_branch.client_id = clients.id', 'left')
|
||||
->where('level_contacts.mobile', $mobile_number )
|
||||
->where('level_contacts.contact_type', 'client')
|
||||
->find();
|
||||
->findAll();
|
||||
|
||||
}else if(isset($this->request->getJSON()->otp)){
|
||||
|
||||
$this->hrModel->where('email', $email)->where('otp', $otp)->where('contact_type', 'client')->set(['otp'=>null])->update();
|
||||
|
||||
$hrData = $this->hrModel ->select('level_contacts.* , client_branch.client_id as client_id')
|
||||
$getAllhrData = $this->hrModel->select('level_contacts.mobile , level_contacts.email , clients.id as client_id, clients.client_name, clients.short_name , client_branch.id as client_branch_id,client_branch.branch_name')
|
||||
->join('client_branch', 'level_contacts.ref_id = client_branch.id', 'left')
|
||||
->join('clients', 'client_branch.client_id = clients.id', 'left')
|
||||
->where('level_contacts.email', $email )
|
||||
->where('level_contacts.contact_type', 'client')
|
||||
->find();
|
||||
->findAll();
|
||||
}
|
||||
|
||||
print_rr($getAllhrData); die;
|
||||
$HRAccessData = $this->getHRAccessData( $hrData['0']['id'] , 'post_enrollment');
|
||||
|
||||
if(isset($HRAccessData['allowed_modules'])){ $hrData['0']['allowed_modules'] = json_decode($HRAccessData['allowed_modules'],true)['post']; }else{ $hrData['0']['allowed_modules'] = []; }
|
||||
@ -690,11 +693,11 @@ class RestAuthenticationController extends AdminController
|
||||
|
||||
} else {
|
||||
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => "Invalid OTP" ],200);
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => "" ],200);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()],500);
|
||||
}
|
||||
// } catch (\Exception $e) {
|
||||
// return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()],500);
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@ -991,7 +994,7 @@ class RestAuthenticationController extends AdminController
|
||||
// // $result = $employeeData;
|
||||
// return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
|
||||
// } else {
|
||||
// return $this->respond(['status' => 'failed','code' => 404,'data' => "Invalid OTP"],200);
|
||||
// return $this->respond(['status' => 'failed','code' => 404,'data' => ""],200);
|
||||
// }
|
||||
// } catch (\Exception $e) {
|
||||
// return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()],500);
|
||||
@ -1016,7 +1019,7 @@ class RestAuthenticationController extends AdminController
|
||||
// print_r($mpin);
|
||||
|
||||
if (!$mpin) {
|
||||
return $this->respond(['status' => 'failed', 'code' => 400, 'data' => 'MPIN is required'], 400);
|
||||
return $this->respond(['status' => 'failed', 'code' => 400, 'data' => "", 'message' => 'MPIN is required'], 400);
|
||||
}
|
||||
|
||||
if ($mobile_number) {
|
||||
@ -1057,7 +1060,7 @@ class RestAuthenticationController extends AdminController
|
||||
$employeeData = $builder->orderBy('employees.id', 'desc')->first();
|
||||
|
||||
} else {
|
||||
return $this->respond(['status' => 'failed', 'code' => 400, 'data' => 'Mobile number or Email ID is required'], 400);
|
||||
return $this->respond(['status' => 'failed', 'code' => 400, 'data' => "", 'message' => 'Mobile number or Email ID is required'], 400);
|
||||
}
|
||||
|
||||
$lastQuery = $this->employeeModel->db->getLastQuery();
|
||||
@ -1095,14 +1098,14 @@ class RestAuthenticationController extends AdminController
|
||||
log_message('error', ' ************************************* POST END **************************************** ');
|
||||
log_message('error', ' ');
|
||||
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => 'Invalid MPIN'], 200);
|
||||
return $this->respond(['status' => 'failed','code' => 404, 'data' => "", 'message' => 'Invalid MPIN'], 200);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyMpin: Exception: " . $e->getMessage() . " --- Line: " . $e->getLine() . " --- Trace: " . $e->getTraceAsString());
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST END **************************************** ');
|
||||
log_message('error', ' ');
|
||||
return $this->respond(['status' => 'failed','code' => 500, 'data' => $e->getMessage()], 500);
|
||||
return $this->respond(['status' => 'failed','code' => 500, 'data' => "", 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user