@webdecoy/fcaptcha 1.29.0 → 1.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/server.js +5 -5
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -1704,7 +1704,7 @@ app.post('/api/score', async (req, res) => {
|
|
|
1704
1704
|
});
|
|
1705
1705
|
|
|
1706
1706
|
app.post('/api/token/verify', (req, res) => {
|
|
1707
|
-
const { token, secret } = req.body;
|
|
1707
|
+
const { token, secret, remoteip } = req.body;
|
|
1708
1708
|
|
|
1709
1709
|
// The secret gate. This endpoint is the boundary between "a browser finished a
|
|
1710
1710
|
// challenge" and "my backend believes it", so it is server-to-server and needs
|
|
@@ -1719,10 +1719,10 @@ app.post('/api/token/verify', (req, res) => {
|
|
|
1719
1719
|
}
|
|
1720
1720
|
}
|
|
1721
1721
|
|
|
1722
|
-
//
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
res.json(verifyToken(token,
|
|
1722
|
+
// This request comes from the integrating backend, not from the visitor who
|
|
1723
|
+
// received the token. Bind only when that trusted backend explicitly supplies
|
|
1724
|
+
// the visitor address; using the caller socket here compares unrelated hosts.
|
|
1725
|
+
res.json(verifyToken(token, typeof remoteip === 'string' && remoteip ? remoteip : null));
|
|
1726
1726
|
});
|
|
1727
1727
|
|
|
1728
1728
|
// Turnstile / reCAPTCHA / hCaptcha drop-in compatibility.
|