message: Added extra login condition when a user has a totp_secret set
diff: @@ -58,9 +58,15 @@ module.exports = function login () {
  afterLogin(user, res, next)
  })
  } else if (user.data && user.data.id && user.data.totp_secret !== '') {
  +
  res.status(401).json({
  status: 'totp_token_requried',
  - data: null
  + data: {
  + tmp_token: insecurity.authorize({
  + user_id: user.data.id,
  + type: 'password_valid_needs_second_factor_token'
  + })
  + }
  })
  } else if (user.data && user.data.id) {
  afterLogin(user, res, next)
  