Exemplo n.º 1
0
 return readUserInfo.password().then((password) => {
   log.info('token', 'creating')
   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().then((otp) => {
       conf.auth.otp = otp
       log.info('token', 'creating with OTP')
       return pulseTillDone.withPromise(profile.createToken(password, readonly, validCIDR, conf))
     })
   })
 }).then((result) => {
Exemplo n.º 2
0
 return readUserInfo.otp().then((otp) => {
   conf.auth.otp = otp
   log.info('token', 'creating with OTP')
   return pulseTillDone.withPromise(profile.createToken(password, readonly, validCIDR, conf))
 })