fix account powers validation

This commit is contained in:
Andre Staltz 2023-11-23 12:10:27 +02:00
parent 3e4fe864f7
commit f8db4fb224
No known key found for this signature in database
GPG Key ID: 9EDE23EA7E8A4890
1 changed files with 6 additions and 1 deletions

View File

@ -729,7 +729,12 @@ function initDB(peer, config) {
return cb(new Error('account.add() failed because opts.powers is not an array'))
}
for (const power of opts.powers) {
if (power !== 'add' && power !== 'del' && power !== 'box') {
if (
power !== 'add' &&
power !== 'del' &&
power !== 'external-encryption' &&
power !== 'internal-encryption'
) {
// prettier-ignore
return cb(new Error(`account.add() failed because opts.powers contains an unknown power "${power}"`))
}