App signature added in all rest api

This commit is contained in:
Gowtham M 2025-12-02 17:16:35 +05:30
parent 17b537b4f1
commit 3d36d8d88e
2 changed files with 38 additions and 26 deletions

View File

@ -439,45 +439,21 @@ $routes->cli('cli/check_bounce_mail_cli', 'MasterController::testCheckBounceMail
$routes->cli('cli/app_check_list', 'MasterController::appCheckList');
$routes->cli('cli/new_gdrive_token', 'GoogleDriveController::generateNewGoogleDriveAccessToken');
//Employee login api's
$routes->post("/employeeRest/verifyEmployeeNumber", "RestAuthenticationController::verifyEmployeeWithMobileNumber");
$routes->post("/employeeRest/getVerifiedUserData", "RestAuthenticationController::getVerifiedUserData");
$routes->post("/employeeRest/verifyEmployeeEmailId", "RestAuthenticationController::verifyEmployeeWithEmailId");
// $routes->post("/employeeRest/saveMpin", "RestAuthenticationController::saveMpin");
//HR login api's
$routes->post("/employeeRest/verifyHrWithMobileNumber", "RestAuthenticationController::verifyHrWithMobileNumber");
$routes->post("/employeeRest/verifyHrWithEmail", "RestAuthenticationController::verifyHrWithEmail");
$routes->post("/employeeRest/getVerifiedHrData", "RestAuthenticationController::getVerifiedHrData");
$routes->group("/api", ["filter" => "authJWT"], function ($routes) {
$routes->post("logined", "RestAuthenticationController::logined");
$routes->post("getId", "RestAuthenticationController::getUserIdFromToken");
});
// MPIN api's
$routes->post("employeeRest/saveMpin", "RestAuthenticationController::saveMpin");
$routes->post("employeeRest/updateMpin", "RestAuthenticationController::updateMpin");
$routes->post("/employeeRest/verifyMpin", "RestAuthenticationController::verifyMpin");
$routes->post("/employeeRest/checkMpin", "RestAuthenticationController::checkMpin");
$routes->post("employeeRest/forgotMPIN", "RestAuthenticationController::forgotMPIN");
$routes->post("employeeRest/updateMobileNumber", "RestAuthenticationController::updateMobileNumber");
// PASSWORD api's
$routes->post("employeeRest/savePassword", "RestAuthenticationController::savePassword");
$routes->post("employeeRest/changePassword", "RestAuthenticationController::changePassword");
$routes->post("employeeRest/verifyPassword", "RestAuthenticationController::verifyPassword");
$routes->post("employeeRest/verifyOtp", "RestAuthenticationController::verifyOtp");
$routes->post("employeeRest/checkPassword", "RestAuthenticationController::checkPassword");
$routes->get("employeeRest/downloadSampleExcel", "EmployeeRestController::downloadSampleExcel");
// $routes->post("employeeRest/createOrUpdateEmployeePolicySiAmount", "EmployeeRestController::createOrUpdateEmployeePolicySiAmount");
// $routes->post("employeeRest/calculatePremium", "EmployeeRestController::calculatePremium");
$routes->group("employeeRest", ["filter" => "authJWT"], function ($routes) {
$routes->group("employeeRest", ["filter" => ["authJWT" , "appSignature"]], function ($routes) {
// $routes->post("getVerifiedUserData", "RestAuthenticationController::getVerifiedUserData");
@ -525,6 +501,39 @@ $routes->group("employeeRest", ["filter" => "authJWT"], function ($routes) {
});
$routes->group("employeeRest", ['filter' => ["appSignature"] ], function ($routes) {
//Employee login api's
$routes->post("verifyEmployeeNumber", "RestAuthenticationController::verifyEmployeeWithMobileNumber");
$routes->post("getVerifiedUserData", "RestAuthenticationController::getVerifiedUserData");
$routes->post("verifyEmployeeEmailId", "RestAuthenticationController::verifyEmployeeWithEmailId");
// $routes->post("saveMpin", "RestAuthenticationController::saveMpin");
//HR login api's
$routes->post("verifyHrWithMobileNumber", "RestAuthenticationController::verifyHrWithMobileNumber");
$routes->post("verifyHrWithEmail", "RestAuthenticationController::verifyHrWithEmail");
$routes->post("getVerifiedHrData", "RestAuthenticationController::getVerifiedHrData");
// MPIN api's
$routes->post("saveMpin", "RestAuthenticationController::saveMpin");
$routes->post("updateMpin", "RestAuthenticationController::updateMpin");
$routes->post("verifyMpin", "RestAuthenticationController::verifyMpin");
$routes->post("checkMpin", "RestAuthenticationController::checkMpin");
$routes->post("forgotMPIN", "RestAuthenticationController::forgotMPIN");
$routes->post("updateMobileNumber", "RestAuthenticationController::updateMobileNumber");
// PASSWORD api's
$routes->post("savePassword", "RestAuthenticationController::savePassword");
$routes->post("changePassword", "RestAuthenticationController::changePassword");
$routes->post("verifyPassword", "RestAuthenticationController::verifyPassword");
$routes->post("verifyOtp", "RestAuthenticationController::verifyOtp");
$routes->post("checkPassword", "RestAuthenticationController::checkPassword");
$routes->get("downloadSampleExcel", "EmployeeRestController::downloadSampleExcel");
});
$routes->get("getEmployeeActiveOrInactivePolicy", "EmployeeRestController::getEmployeeActiveOrInactivePolicy");
$routes->get("sendPushNotification", "EmployeeRestController::sendPushNotification");
$routes->post("sendEmail", "EmployeeRestController::send_email");

View File

@ -69,7 +69,10 @@ class RestAuthenticationController extends AdminController
{
$client = \Config\Services::curlrequest();
$url = env('POST_ENROLLMENT_BASEURL').$endPoint;
$response = $client->post( $url, ['json' => $postData, 'http_errors' => false ] );
$headers = [
'App-Signature' => getenv('APP_SIGNATURE'),
];
$response = $client->post( $url, ['json' => $postData, 'headers' => $headers , 'http_errors' => false ] );
// return json_decode($response->getBody(), true);
return $response->getBody();
}