reject registration if the account is deactivated (#53)

* reject registration if the account is deactivated

* reject registration if the account is deactivated
This commit is contained in:
Hoan Luu Huu
2024-01-17 20:55:59 +07:00
committed by GitHub
parent de3100a4b4
commit 4079f7b83b
4 changed files with 24 additions and 0 deletions
+6
View File
@@ -64,6 +64,12 @@ const checkAccountLimits = async(req, res, next) => {
const {registrar, writeAlerts, AlertType} = req.srf.locals;
try {
const account = await lookupAccountBySipRealm(realm);
if (account && !account.is_active) {
logger.debug('checkAccountLimits: account is deactivated, reject registration');
return res.send(403, {headers: {
'X-Reason': 'Account has been deactivated'
}});
}
if (account) {
req.locals = {
...req.locals,