Additional security hardening.
This commit is contained in:
@@ -50,7 +50,7 @@ async function getEntegralShopData() {
|
||||
}
|
||||
|
||||
exports.default = async (req, res) => {
|
||||
res.sendStatus(200);
|
||||
res.sendStatus(401);
|
||||
return;
|
||||
//Query for the List of Bodyshop Clients.
|
||||
const job = req.body.event.data.new;
|
||||
|
||||
@@ -40,6 +40,14 @@ exports.default = async (req, res) => {
|
||||
|
||||
const specificShopIds = req.body.bodyshopIds; // ['uuid]
|
||||
const { start, end, skipUpload } = req.body; //YYYY-MM-DD
|
||||
if (
|
||||
!start ||
|
||||
!moment(start).isValid ||
|
||||
req.headers["x-imex-auth"] !== process.env.AUTOHOUSE_AUTH_TOKEN
|
||||
) {
|
||||
res.sendStatus(401);
|
||||
return;
|
||||
}
|
||||
const allxmlsToUpload = [];
|
||||
const allErrors = [];
|
||||
try {
|
||||
@@ -772,7 +780,9 @@ const CreateCosts = (job) => {
|
||||
billTotalsByCostCenters[
|
||||
job.bodyshop.md_responsibility_centers.defaults.costs.MAPA
|
||||
] = Dinero({
|
||||
amount: Math.round((job.mixdata[0] && job.mixdata[0].totalliquidcost || 0) * 100)
|
||||
amount: Math.round(
|
||||
((job.mixdata[0] && job.mixdata[0].totalliquidcost) || 0) * 100
|
||||
),
|
||||
});
|
||||
} else {
|
||||
billTotalsByCostCenters[
|
||||
|
||||
Reference in New Issue
Block a user