diff --git a/lib/utils/otplease.js b/lib/utils/otplease.js index 62a779afc7f1d..8bfe7da1d387f 100644 --- a/lib/utils/otplease.js +++ b/lib/utils/otplease.js @@ -8,7 +8,7 @@ async function otplease (npm, opts, fn) { const isBackwardsCompatibleOTP = err.code === 'E401' && /one-time pass/.test(err.body) const isClassicOTP = err.code === 'EOTP' - const isWebOTP = err.code === 'EOTP' && err.body.authUrl && err.body.doneUrl + const isWebOTP = err.code === 'EOTP' && err.body?.authUrl && err.body?.doneUrl if (isWebOTP) { const webAuth = require('./web-auth')