salix/modules/account/back/models/sip-config.js

19 lines
484 B
JavaScript
Raw Normal View History

const app = require('vn-loopback/server/server');
module.exports = Self => {
Self.getSynchronizer = async function() {
return await Self.findOne({fields: ['id']});
};
Object.assign(Self.prototype, {
async syncUser(userName, info, password) {
if (!info.hasAccount || !password) return;
await app.models.Account.rawSql('CALL pbx.sip_setPassword(?, ?)',
[info.user.id, password]
);
}
});
};