mirror of
https://github.com/HeyPuter/puter.git
synced 2026-09-20 12:15:57 +00:00
dev: add ip to captcha middleware event
This commit is contained in:
@@ -37,9 +37,12 @@ const checkCaptcha = ({ svc_captcha }) => async (req, res, next) => {
|
||||
req.captchaRequired = false;
|
||||
return next();
|
||||
}
|
||||
const ip = req.headers?.['x-forwarded-for'] ||
|
||||
req.connection?.remoteAddress;
|
||||
|
||||
const svc_event = services.get('event');
|
||||
const event = {
|
||||
ip,
|
||||
// By default, captcha always appears if enabled
|
||||
required: true,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user