allow registration if checkAccountLimits cannot reach DB (#104)

This commit is contained in:
Hoan Luu Huu
2025-05-22 19:14:39 +07:00
committed by GitHub
parent 0bb72ed09f
commit ae5b05e9e9

View File

@@ -132,6 +132,10 @@ const checkAccountLimits = async(req, res, next) => {
next();
} catch (err) {
logger.error({err, realm}, 'checkAccountLimits: error checking account limits');
// if we can not reach the db for some reason, allow the registration to proceed
if (err.message?.includes('connect ECONNREFUSED')) {
return next();
}
res.send(500);
}
};