From b929c6e493f5e6a22eb8e3dec580104c02a5041d Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 31 Aug 2022 14:34:25 -0700 Subject: return json for 2fa endpoints --- routes/users.js | 5 +++-- 1 file 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({}); }) ); -- cgit v1.2.3