aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2020-05-18 18:38:20 -0400
committerAdam Soltys <[email protected]>2020-05-18 18:38:22 -0400
commit5ba721a904fdd760d33924d40479129069c70a1e (patch)
tree0b10540405196e92099fdbc908ce9f308e55ccb1
parent8ffd969ff2f50af4116edb2050ae5c95e2af6f41 (diff)
downloadcoinos-server-5ba721a904fdd760d33924d40479129069c70a1e.tar.gz
coinos-server-5ba721a904fdd760d33924d40479129069c70a1e.zip
captcha score logging
-rw-r--r--routes/liquid/fee.js4
-rw-r--r--routes/users.js5
2 files changed, 5 insertions, 4 deletions
diff --git a/routes/liquid/fee.js b/routes/liquid/fee.js
index 6a884657..d43e6e9d 100644
--- a/routes/liquid/fee.js
+++ b/routes/liquid/fee.js
@@ -16,7 +16,7 @@ module.exports = async (req, res) => {
tx = await lq.createRawTransaction(
[],
{
- [address]: fixed(amount, 8),
+ [address]: (amount / SATS).toFixed(8)
},
0,
false,
@@ -45,7 +45,7 @@ module.exports = async (req, res) => {
res.send({ feeRate, tx });
} catch (e) {
- l.error("error estimating liquid fee", e);
+ l.error("error estimating liquid fee", e.message);
return res.status(500).send(e.message);
}
};
diff --git a/routes/users.js b/routes/users.js
index bc4debdf..f5c8df03 100644
--- a/routes/users.js
+++ b/routes/users.js
@@ -83,6 +83,7 @@ app.post("/register", async (req, res) => {
let ip = req.headers["x-forwarded-for"] || req.connection.remoteAddress;
+ let success, score;
try {
const url = `https://www.google.com/recaptcha/api/siteverify?secret=${config.captcha}&response=${user.token}&remoteip=${ip}`;
let captcha = await axios.post(
@@ -95,7 +96,7 @@ app.post("/register", async (req, res) => {
{ timeout: 1000 }
);
- let { success, score } = captcha.data;
+ ({ success, score } = captcha.data);
if (!success || score < 0.3) {
l.warn("failed registration attempt", ip);
@@ -157,7 +158,7 @@ app.post("/register", async (req, res) => {
user = await getUser(user.username);
res.send(pick(user, ...whitelist));
emit(user.username, "user", user);
- l.info("new user", user.username, ip);
+ l.info("new user", user.username, ip, token, score);
});
app.post("/disable2fa", auth, twofa, async (req, res) => {