Files
Thomas Lynch af3bbb66e7 Add a global option to force accounts to require 2fa
Add a global option to force changing board settings to need 2FA
2024-05-26 00:56:09 +10:00

19 lines
547 B
JavaScript

'use strict';
module.exports = async(db, redis) => {
console.log('Updating globalsettings to add 2fa enforcement options');
await db.collection('globalsettings').updateOne({ _id: 'globalsettings' }, {
'$set': {
'forceAccountTwofactor': false,
'forceActionTwofactor': false, //TODO: potentially break this down to be more granular on what needs 2fa
},
});
console.log('Clearing globalsettings cache');
await redis.deletePattern('globalsettings');
console.log('Clearing boards cache');
await redis.deletePattern('board:*');
};