fix registration hook

This commit is contained in:
Quan HL
2023-06-15 06:21:37 +07:00
parent 1974abfcf7
commit 54ccaa52bb
2 changed files with 7 additions and 8 deletions
+6 -4
View File
@@ -68,10 +68,12 @@ const checkAccountLimits = async(req, res, next) => {
...req.locals, ...req.locals,
account_sid: account.account_sid, account_sid: account.account_sid,
webhook_secret: account.webhook_secret, webhook_secret: account.webhook_secret,
registration_hook_url: account.registration_hook.url, ...(account.registration_hook && {
registration_hook_method: account.registration_hook.method, registration_hook_url: account.registration_hook.url,
registration_hook_username: account.registration_hook.username, registration_hook_method: account.registration_hook.method,
registration_hook_password: account.registration_hook.password registration_hook_username: account.registration_hook.username,
registration_hook_password: account.registration_hook.password
})
}; };
debug(account, `checkAccountLimits: retrieved account for realm: ${realm}`); debug(account, `checkAccountLimits: retrieved account for realm: ${realm}`);
} }
+1 -4
View File
@@ -189,10 +189,7 @@ const digestChallenge = async(req, res, next) => {
const {stats} = req.srf.locals; const {stats} = req.srf.locals;
const { const {
account_sid, account_sid,
registration_hook_url, registration_hook,
registration_hook_method,
registration_hook_username,
registration_hook_password,
webhook_secret webhook_secret
} = req.locals; } = req.locals;
// Cannot detect account, reject register request // Cannot detect account, reject register request