This commit is contained in:
Josh Harvey 2017-03-20 16:43:40 +02:00
parent a35e9d2d44
commit 340ad2b518
8 changed files with 129 additions and 38 deletions

View file

@ -150,7 +150,11 @@ function pair (req, res, next) {
return pairing.pair(token, deviceId)
.then(valid => {
if (valid) return res.end()
if (valid) {
return helpers.updateMachineDefaults(deviceId)
.then(() => res.json({status: 'paired'}))
}
throw httpError('Pairing failed')
})
.catch(next)