Identify machine name on logging upon clock skew error (#188)
This commit is contained in:
parent
85295ea62c
commit
7a07412a70
2 changed files with 13 additions and 4 deletions
|
|
@ -71,10 +71,17 @@ function authorizeCaDownload (caToken) {
|
|||
}
|
||||
|
||||
function isPaired (deviceId) {
|
||||
const sql = 'select device_id from devices where device_id=$1 and paired=TRUE'
|
||||
const sql = 'select device_id, name from devices where device_id=$1 and paired=TRUE'
|
||||
|
||||
return db.oneOrNone(sql, [deviceId])
|
||||
.then(row => row && row.device_id === deviceId)
|
||||
.then(row => {
|
||||
const deviceName = row.name
|
||||
const isDevicePaired = row && row.device_id === deviceId
|
||||
return {
|
||||
deviceName: deviceName,
|
||||
isDevicePaired: isDevicePaired
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = {pair, unpair, authorizeCaDownload, isPaired}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue