aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--routes/users.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/routes/users.js b/routes/users.js
index 10eec095..ea96764b 100644
--- a/routes/users.js
+++ b/routes/users.js
@@ -15,8 +15,8 @@ const twofa = (req, res, next) => {
} = req;
if (
user.twofa &&
- (typeof twofa === "undefined" ||
- !authenticator.check(twofa, user.otpsecret))
+ (typeof token === "undefined" ||
+ !authenticator.check(token, user.otpsecret))
) {
return res.status(401).send("2fa required");
} else next();