This pull request includes updates to the openapi.yaml file and several JavaScript files to enhance the logging of IP addresses by using the x-forwarded-for header when available. This change ensures that the correct client IP address is logged, even when the application is behind a proxy.
This pull request includes updates to the
openapi.yaml
file and several JavaScript files to enhance the logging of IP addresses by using thex-forwarded-for
header when available. This change ensures that the correct client IP address is logged, even when the application is behind a proxy.Updates to IP address logging:
src/controllers/userController.js
: Modified multiple functions (createUser
,getUser
,editUser
,deleteUser
) to log the IP address usingreq.headers['x-forwarded-for'] || req.ip
. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]src/controllers/validationController.js
: Updated thevalidate
function to log the IP address usingreq.headers['x-forwarded-for'] || req.ip
.src/middleware/authMiddleware.js
: Modified theuserExists
andauthorizeRequest
functions to log the IP address usingreq.headers['x-forwarded-for'] || req.ip
. [1] [2] [3] [4] [5]src/middleware/validationMiddleware.js
: Updated thevalidateToken
function to log the IP address usingreq.headers['x-forwarded-for'] || req.ip
. [1] [2]Miscellaneous update:
openapi.yaml
: Changed the server URL to include/auth
in the base path.