From d140e6fbbbe68c8f3b122f30c2f1c2b17912b6d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20M=C3=B8ller=20Ellehauge?= Date: Wed, 29 Jun 2022 10:45:26 +0200 Subject: [PATCH] fix: check for 'one-time pass' in proper field The regex would always return false in the previous implementation, because 'err.body' was an object. --- lib/utils/otplease.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/otplease.js b/lib/utils/otplease.js index bfae8152c8e07..4463381f666b8 100644 --- a/lib/utils/otplease.js +++ b/lib/utils/otplease.js @@ -10,7 +10,7 @@ async function otplease (opts, fn) { throw err } - if (/one-time pass/.test(err.body)) { + if (/one-time pass/.test(err.body?.error)) { const readUserInfo = require('./read-user-info.js') const otp = await readUserInfo.otp('This operation requires a one-time password.\nEnter OTP:') return await fn({ ...opts, otp })