[user][ban] ensure no init emails get sent out to banned users

This commit is contained in:
Andrea Vos 2022-05-25 19:03:56 +02:00
parent 4020b0bfbf
commit 14a255812a

View File

@ -314,6 +314,10 @@ router.post('/user/init', handleErrorAsync(async (req, res) => {
return res.json({ error: 'user.account.changeEmail.invalid' })
}
if (await lookupBanArchive(req.db, 'email', payload)) {
throw 'banned';
}
let codeKey;
if (isTest) {
codeKey = await saveAuthenticator(req.db, 'email', user, payload, 15);