mirror of
https://github.com/jambonz/sbc-inbound.git
synced 2025-12-19 04:37:43 +00:00
13 lines
308 B
JavaScript
13 lines
308 B
JavaScript
const {fromInboundTrunk} = require('./utils');
|
|
const config = require('config');
|
|
const authenticator = require('drachtio-http-authenticator')(config.get('authCallback'));
|
|
|
|
function auth(req, res, next) {
|
|
if (fromInboundTrunk) return next();
|
|
authenticator(req, res, next);
|
|
}
|
|
|
|
module.exports = {
|
|
auth
|
|
};
|