Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Deniau <julien.deniau@gmail.com>2018-07-21 01:03:35 +0300
committerKat Marchán <kzm@zkat.tech>2018-07-21 01:03:35 +0300
commit21cf0ab68cf528d5244ae664133ef400bdcfbdb6 (patch)
tree455d573ce029353a3249e995dbfb4cb3c8b21170 /lib/token.js
parenta9ac8712dfafcb31a4e3deca24ddb92ff75e942d (diff)
profile: better explanation on OTP (#24)
Use the defaut OTP explanation everywhere except when the context is "OTP-aware" (like when setting double-authentication) PR-URL: https://github.com/npm/cli/pull/24 Credit: @jdeniau Reviewed-By: @zkat
Diffstat (limited to 'lib/token.js')
-rw-r--r--lib/token.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/token.js b/lib/token.js
index 8745bf9b0..d442d37eb 100644
--- a/lib/token.js
+++ b/lib/token.js
@@ -164,7 +164,7 @@ function rm (args) {
return profile.removeToken(key, conf).catch((ex) => {
if (ex.code !== 'EOTP') throw ex
log.info('token', 'failed because revoking this token requires OTP')
- return readUserInfo.otp('Authenticator provided OTP:').then((otp) => {
+ return readUserInfo.otp().then((otp) => {
conf.auth.otp = otp
return profile.removeToken(key, conf)
})
@@ -192,7 +192,7 @@ function create (args) {
return profile.createToken(password, readonly, validCIDR, conf).catch((ex) => {
if (ex.code !== 'EOTP') throw ex
log.info('token', 'failed because it requires OTP')
- return readUserInfo.otp('Authenticator provided OTP:').then((otp) => {
+ return readUserInfo.otp().then((otp) => {
conf.auth.otp = otp
log.info('token', 'creating with OTP')
return pulseTillDone.withPromise(profile.createToken(password, readonly, validCIDR, conf))