App signature added in all rest api
This commit is contained in:
parent
3d36d8d88e
commit
bc1f91acea
@ -21,7 +21,7 @@ class Feature extends BaseConfig
|
||||
* - property $filtersInfo, instead of $filterInfo
|
||||
* - CodeIgniter\Router\RouteCollection::getFiltersForRoute(), instead of getFilterForRoute()
|
||||
*/
|
||||
public bool $multipleFilters = false;
|
||||
public bool $multipleFilters = true;
|
||||
|
||||
/**
|
||||
* Use improved new auto routing instead of the default legacy version.
|
||||
|
||||
@ -39,6 +39,7 @@ class Filters extends BaseConfig
|
||||
'CloseDbConnection' => CloseDbConnection::class,
|
||||
'Cors' => Cors::class,
|
||||
'appSignature' => VerifyAppSignature::class,
|
||||
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@ -453,7 +453,7 @@ $routes->group("/api", ["filter" => "authJWT"], function ($routes) {
|
||||
// $routes->post("employeeRest/createOrUpdateEmployeePolicySiAmount", "EmployeeRestController::createOrUpdateEmployeePolicySiAmount");
|
||||
// $routes->post("employeeRest/calculatePremium", "EmployeeRestController::calculatePremium");
|
||||
|
||||
$routes->group("employeeRest", ["filter" => ["authJWT" , "appSignature"]], function ($routes) {
|
||||
$routes->group("employeeRest", ['filter' => ['authJWT', 'appSignature'] ], function ($routes) {
|
||||
|
||||
// $routes->post("getVerifiedUserData", "RestAuthenticationController::getVerifiedUserData");
|
||||
|
||||
@ -501,7 +501,7 @@ $routes->group("employeeRest", ["filter" => ["authJWT" , "appSignature"]], funct
|
||||
|
||||
});
|
||||
|
||||
$routes->group("employeeRest", ['filter' => ["appSignature"] ], function ($routes) {
|
||||
$routes->group("employeeRest", ['filter' => ['appSignature'] ], function ($routes) {
|
||||
|
||||
//Employee login api's
|
||||
$routes->post("verifyEmployeeNumber", "RestAuthenticationController::verifyEmployeeWithMobileNumber");
|
||||
@ -547,7 +547,7 @@ $routes->cli("cli/sendCroneRemainderMail", "DashboardController::sendCroneRemain
|
||||
|
||||
$routes->get('enrollOpendAndClose', 'DashboardController::updatePolicyEnrollmentStatus');
|
||||
$routes->get("sendCroneRemainderMail", "DashboardController::sendCroneRemainderMail");
|
||||
$routes->get("getEmployeePolicy", "EmployeeRestController::getEmployeePolicy");
|
||||
// $routes->get("getEmployeePolicy", "EmployeeRestController::getEmployeePolicy");
|
||||
$routes->get("getAddOnPolicy", "EmployeeRestController::getAddOnPolicy");
|
||||
$routes->post("addEmployeeAndDependence", "EmployeeRestController::addEmployeeAndDependence");
|
||||
$routes->post("getPreEmployeePolicyCount", "EmployeeRestController::getPreEmployeePolicyCount");
|
||||
|
||||
@ -20,7 +20,7 @@ class AuthJWT implements FilterInterface
|
||||
{
|
||||
public function before(RequestInterface $request, $arguments = null)
|
||||
{
|
||||
$jwt = $request->getHeader('Authorization');
|
||||
$jwt = $request->getHeaderLine('Authorization');
|
||||
|
||||
if ($jwt) {
|
||||
if (JWTToken::validateJWT($jwt)) {
|
||||
|
||||
@ -13,6 +13,8 @@ class VerifyAppSignature implements FilterInterface
|
||||
// Get the header sent by the Flutter app
|
||||
$clientSignature = $request->getHeaderLine('App-Signature');
|
||||
|
||||
dd($clientSignature);
|
||||
|
||||
// Load the server's expected signature from the .env
|
||||
$validSignature = getenv('APP_SIGNATURE');
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user