From fceff42eba1f2d270402f72cc5a47548a083acf7 Mon Sep 17 00:00:00 2001 From: alex-phillips Date: Wed, 26 Feb 2020 08:34:02 -0500 Subject: [PATCH] adjusted length of totp secret in case someone has to manually type it in --- routes/users.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/users.js b/routes/users.js index 817351d..28855b6 100644 --- a/routes/users.js +++ b/routes/users.js @@ -137,7 +137,7 @@ router.put('/:id', upload.single('avatar'), async (req, res, next) => { // Begin process to set up and confirm multi-factor authentication if (user.multifactorEnabled === false && !!req.body.multifactorEnabled === true) { - const secret = Speakeasy.generateSecret() + const secret = Speakeasy.generateSecret({ length: 16 }) const qrcode = await QRCode.toDataURL(secret.otpauth_url, { scale: 6 }) user.update({