Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better explanation on OTP #24

Merged
merged 1 commit into from
Jul 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/auth/legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function login (conf) {
})
.catch((err) => {
if (err.code !== 'EOTP') throw err
return read.otp('Authenticator provided OTP:').then((otp) => {
return read.otp('Enter one-time password from your authenticator app: ').then((otp) => {
conf.auth.otp = otp
const u = conf.creds.username
const p = conf.creds.password
Expand Down
4 changes: 2 additions & 2 deletions lib/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ function set (args) {
newUser[prop] = value
return profile.set(newUser, conf).catch((err) => {
if (err.code !== 'EOTP') throw err
return readUserInfo.otp('Enter OTP: ').then((otp) => {
return readUserInfo.otp().then((otp) => {
conf.auth.otp = otp
return profile.set(newUser, conf)
})
Expand Down Expand Up @@ -262,7 +262,7 @@ function enable2fa (args) {
return pulseTillDone.withPromise(profile.set({tfa: {password, mode: 'disable'}}, conf))
} else {
if (conf.auth.otp) return
return readUserInfo.otp('Enter OTP: ').then((otp) => {
return readUserInfo.otp('Enter one-time password from your authenticator app: ').then((otp) => {
conf.auth.otp = otp
})
}
Expand Down
4 changes: 2 additions & 2 deletions lib/token.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
Expand Down Expand Up @@ -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))
Expand Down