Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev
This commit is contained in:
commit
e1f9f86b6b
@ -241,6 +241,7 @@ $routes->cli('cli/processjobs', 'JobWorker::processJobs');
|
||||
$routes->get("processjob", "JobWorker::processJob");
|
||||
|
||||
|
||||
|
||||
//Employee login api's
|
||||
$routes->post("/employeeRest/verifyEmployeeNumber", "RestAuthenticationController::verifyEmployeeWithMobileNumber");
|
||||
$routes->post("/employeeRest/getVerifiedUserData", "RestAuthenticationController::getVerifiedUserData");
|
||||
@ -253,15 +254,11 @@ $routes->group("/api", ["filter" => "authJWT"], function ($routes) {
|
||||
$routes->post("getId", "RestAuthenticationController::getUserIdFromToken");
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
$routes->get("/getEmployeeProfile", "EmployeeRestController::getEmployeeProfile/$1");
|
||||
$routes->post("/editEmployeeProfile", "EmployeeRestController::editEmployeeProfile");
|
||||
$routes->post("/calculatePremium", "EmployeeRestController::calculatePremium");
|
||||
|
||||
|
||||
$routes->get("getEmployeeActiveOrInactivePolicy", "EmployeeRestController::getEmployeeActiveOrInactivePolicy");
|
||||
|
||||
$routes->group("employeeRest", ["filter" => "authJWT"], function ($routes) {
|
||||
|
||||
|
||||
@ -94,7 +94,12 @@ class EmployeeRestController extends AdminController
|
||||
->where('relationship', $relationship)
|
||||
->first();
|
||||
$result = $employee;
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
|
||||
$AccountManagerDetails = $this->clientRMModel->select('client_rm.* , user_profiles.*')
|
||||
->join('user_profiles', 'client_rm.user_id = user_profiles.id', 'left')
|
||||
->where('client_rm.client_id', $client_id )
|
||||
->where('client_rm.level', 3 )
|
||||
->findAll();
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result, 'AccountManagerDetails'=> isset($AccountManagerDetails[0]) ? $AccountManagerDetails[0] : null ],200);
|
||||
} else {
|
||||
$result = "No Match's";
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => $result],404);
|
||||
|
||||
@ -24,9 +24,17 @@ class AuthJWT implements FilterInterface
|
||||
if (JWTToken::validateJWT($jwt)) {
|
||||
$data = JWTToken::validateJWT($jwt);
|
||||
$data = json_decode($data);
|
||||
|
||||
if ($data->status) {
|
||||
// $auth = $request->getHeader("Authorization");
|
||||
|
||||
// $decodedToken = $data->decoded;
|
||||
|
||||
// $decodedToken->exp += 30;
|
||||
// $newJwt = JWTToken::encode((array)$decodedToken);
|
||||
|
||||
// Set the new JWT in the response headers
|
||||
// $response = service('response');
|
||||
// $response->setHeader('Authorization', $newJwt);
|
||||
return true;
|
||||
}else{
|
||||
header('Content-Type: application/json');
|
||||
|
||||
@ -20,7 +20,7 @@ class JWTToken
|
||||
{
|
||||
$secret_Key="secret";
|
||||
$iat = time();
|
||||
$exp = $iat + 36000;
|
||||
$exp = $iat + 180;
|
||||
$request_data = [
|
||||
"iat" => $iat,
|
||||
"exp" => $exp,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user