quickfix2

This commit is contained in:
Dag Heyman 2020-06-22 11:36:57 +02:00
parent 1d96ddc01b
commit e311d54e6e
2 changed files with 18 additions and 1 deletions

View File

@ -243,6 +243,12 @@ class Controller(object):
else:
version = ""
try:
controller = OathController(dev.driver)
dev.has_password = controller.locked
except Exception as e:
logger.debug("Could not read out password for oath")
if serial not in handled_serials:
handled_serials.add(serial)
@ -290,7 +296,7 @@ class Controller(object):
'canWriteConfig': dev.can_write_config,
'configurationLocked': dev.config.configuration_locked,
'formFactor': dev.config.form_factor,
'hasPassword': False, # Could be true but we dont know yet
'hasPassword': dev.has_password or False,
'isNfc': self._reader_filter and not self._reader_filter.lower().startswith("yubico yubikey")
}
@ -300,6 +306,13 @@ class Controller(object):
if reader_filter:
self._reader_filter = reader_filter
dev = self._get_dev_from_reader()
try:
controller = OathController(dev.driver)
dev.has_password = controller.locked
except Exception as e:
logger.debug("Could not read out password for oath")
if dev:
self._devices.append(self._serialise_dev(dev))
return success({'devices': self._devices})

View File

@ -256,6 +256,10 @@ Python {
refreshDevices(customReaderName, function (resp) {
if (resp.success) {
availableDevices = resp.devices
if (availableDevices.length === 0) {
clearCurrentDeviceAndEntries()
navigator.home()
}
// no current device, or current device is no longer available, pick a new one
if (!currentDevice || !availableDevices.some(dev => dev.serial === currentDevice.serial)) {
// new device is being loaded, clear any old device