feat client direct call from registration webhook (#562)

* feat client direct call from registration webhook

* feat client direct call from registration webhook

* wip
This commit is contained in:
Hoan Luu Huu
2023-12-11 20:36:19 +07:00
committed by GitHub
parent bb81f9f3da
commit 230fe9ea11

View File

@@ -52,10 +52,16 @@ module.exports = function(srf, logger) {
let clientDb = null;
if (req.has('X-Authenticated-User')) {
req.locals.originatingUser = req.get('X-Authenticated-User');
let clientSettings;
const arr = /^(.*)@(.*)/.exec(req.locals.originatingUser);
if (arr) {
[clientDb] = await lookupClientByAccountAndUsername(account_sid, arr[1]);
[clientSettings] = await lookupClientByAccountAndUsername(account_sid, arr[1]);
}
clientDb = await registrar.query(req.locals.originatingUser);
clientDb = {
...clientDb,
...clientSettings,
};
}
// check for call to application