WIP
This commit is contained in:
parent
cd1e9bdb66
commit
3e48e50757
5 changed files with 110 additions and 11 deletions
|
|
@ -224,6 +224,24 @@ function phoneCode (req, res) {
|
|||
})
|
||||
}
|
||||
|
||||
function updatePhone (req, res) {
|
||||
return plugins.updatePhone(session(req), req.body.phone)
|
||||
.then(code => res.send(200))
|
||||
.catch(err => {
|
||||
logger.error(err)
|
||||
res.send(500)
|
||||
})
|
||||
}
|
||||
|
||||
function fetchPhoneTx (req, res) {
|
||||
return plugins.updatePhone(req.query.phone)
|
||||
.then(code => res.send(200))
|
||||
.catch(err => {
|
||||
logger.error(err)
|
||||
res.send(500)
|
||||
})
|
||||
}
|
||||
|
||||
function init (localConfig) {
|
||||
lamassuConfig = localConfig.lamassuConfig
|
||||
plugins = localConfig.plugins
|
||||
|
|
@ -248,6 +266,8 @@ function init (localConfig) {
|
|||
app.post('/pair', pair)
|
||||
|
||||
app.post('/phone_code', authMiddleware, phoneCode)
|
||||
app.post('/update-phone', authMiddleware, updatePhone)
|
||||
app.get('/phone-tx', authMiddleware, fetchPhoneTx)
|
||||
|
||||
localApp.get('/pid', function (req, res) {
|
||||
var machineFingerprint = req.query.fingerprint
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue