Added opt-in option for promotional emails

This commit is contained in:
2021-02-11 16:01:39 +11:00
parent 7759a1cd40
commit 615b686890
19 changed files with 848 additions and 83 deletions
-23
View File
@@ -16,27 +16,4 @@ router.get('/banned', require('./banned'));
router.post('/ban', require('./ban'));
router.post('/unban', require('./unban'));
//DOCS: ensure that there is at least one administration account
const bcrypt = require('bcryptjs');
const { accounts } = require('../database/models');
(async () => {
const admin = await accounts.findOne({
where: {
privilege: 'administrator'
}
});
if (admin == null) {
await accounts.create({
privilege: 'administrator',
email: `admin@${process.env.WEB_ADDRESS}`,
username: `admin`,
hash: await bcrypt.hash('password', await bcrypt.genSalt(11))
});
console.log(`Created default admin account (email: admin@${process.env.WEB_ADDRESS}; password: password)`);
}
})();
module.exports = router;