Fix: fix promise in findOperatorId

This commit is contained in:
csrapr 2021-01-28 14:35:17 +00:00 committed by Josh Harvey
parent afb5ceea71
commit fc39d9b1a3

View file

@ -19,12 +19,15 @@ function getMnemonic () {
}
function findOperatorId (req, res, next) {
getMnemonic().then(mnemonic => {
return getMnemonic().then(mnemonic => {
return computeOperatorId(mnemonicHelpers.toEntropyBuffer(mnemonic))
}).then(id => {
res.locals.operatorId = id
}).catch(e => console.error('Error while computing operator id\n' + e))
next()
return next()
}).catch(e => {
console.error('Error while computing operator id\n' + e)
next(e)
})
}
module.exports = findOperatorId