mirror of
https://github.com/jambonz/sbc-sip-sidecar.git
synced 2026-07-04 19:32:03 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user