UC done v1.0

This commit is contained in:
andrei-mihnea-cerbu
2024-03-27 17:15:57 +02:00
parent 5f902e1a28
commit d1d238287a
56 changed files with 4964 additions and 81 deletions
+12
View File
@@ -0,0 +1,12 @@
const { sendResponse } = require('../helpers/responseHelper');
const {httpStatus, httpStatusMessages} = require('../helpers/httpResponses')
function apiKeyValidation(req, res, next) {
const apiKey = req.headers['x-api-key'];
if (apiKey !== req.app.locals.apiKey) {
return sendResponse(res, httpStatus.UNAUTHORIZED, httpStatusMessages[httpStatus.UNAUTHORIZED]);
}
next();
}
module.exports = apiKeyValidation;