mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-26 02:35:25 +02:00
VNC authentication works, although there is no UI for adding passwords
yet. Direct database manipulation is required for now.
This commit is contained in:
@@ -100,6 +100,27 @@ dbapi.lookupUserByAdbFingerprint = function(fingerprint) {
|
||||
})
|
||||
}
|
||||
|
||||
dbapi.lookupUserByVncAuthResponse = function(response, serial) {
|
||||
return db.run(r.table('vncauth').getAll([response, serial], {
|
||||
index: 'responsePerDevice'
|
||||
})
|
||||
.eqJoin('userId', r.table('users'))('right')
|
||||
.pluck('email', 'name', 'group'))
|
||||
.then(function(cursor) {
|
||||
return cursor.toArray()
|
||||
})
|
||||
.then(function(groups) {
|
||||
switch (groups.length) {
|
||||
case 1:
|
||||
return groups[0]
|
||||
case 0:
|
||||
return null
|
||||
default:
|
||||
throw new Error('Found multiple users with the same VNC response')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
dbapi.loadGroup = function(email) {
|
||||
return db.run(r.table('devices').getAll(email, {
|
||||
index: 'owner'
|
||||
|
||||
Reference in New Issue
Block a user