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

This commit is contained in:
Andrea 2022-05-25 19:03:56 +02:00
parent f5c6d5b1dd
commit 62f0bd6b71
1 changed files with 4 additions and 0 deletions

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);