mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +00:00
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:
@@ -52,10 +52,16 @@ module.exports = function(srf, logger) {
|
|||||||
let clientDb = null;
|
let clientDb = null;
|
||||||
if (req.has('X-Authenticated-User')) {
|
if (req.has('X-Authenticated-User')) {
|
||||||
req.locals.originatingUser = req.get('X-Authenticated-User');
|
req.locals.originatingUser = req.get('X-Authenticated-User');
|
||||||
|
let clientSettings;
|
||||||
const arr = /^(.*)@(.*)/.exec(req.locals.originatingUser);
|
const arr = /^(.*)@(.*)/.exec(req.locals.originatingUser);
|
||||||
if (arr) {
|
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
|
// check for call to application
|
||||||
|
|||||||
Reference in New Issue
Block a user