aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-08-31 14:34:25 -0700
committerAdam Soltys <[email protected]>2022-08-31 14:34:25 -0700
commitb929c6e493f5e6a22eb8e3dec580104c02a5041d (patch)
tree57130a13416070b0f2a64d9b22b9c9e861e6f9cd
parentc5ff0fdfa9ec1213063ffdc5ba1a72946319d4cd (diff)
downloadcoinos-server-b929c6e493f5e6a22eb8e3dec580104c02a5041d.tar.gz
coinos-server-b929c6e493f5e6a22eb8e3dec580104c02a5041d.zip
return json for 2fa endpoints
-rw-r--r--routes/users.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/routes/users.js b/routes/users.js
index 71a6abac..8a6506e1 100644
--- a/routes/users.js
+++ b/routes/users.js
@@ -97,7 +97,7 @@ app.post(
emit(user.username, "user", user);
emit(user.username, "otpsecret", user.otpsecret);
l.info("disabled 2fa", user.username);
- res.end();
+ res.send({});
})
);
@@ -117,6 +117,7 @@ app.post(
auth,
ah(async (req, res) => {
let { user } = req;
+ console.log(authenticator.generate(req.user.otpsecret), req.body.token);
try {
const isValid = authenticator.check(req.body.token, req.user.otpsecret);
if (isValid) {
@@ -131,7 +132,7 @@ app.post(
}
l.info("enabled 2fa", user.username);
- res.end();
+ res.send({});
})
);