Skip to content

Commit

Permalink
fix: check for 'one-time pass' in proper field
Browse files Browse the repository at this point in the history
The regex would always return false in the previous implementation, because 'err.body'
was an object.
  • Loading branch information
jumoel committed Jun 29, 2022
1 parent cf6be7c commit d140e6f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils/otplease.js
Expand Up @@ -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 })
Expand Down

0 comments on commit d140e6f

Please sign in to comment.