mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-11-25 05:52:40 +03:00
commit
88adf77dd1
@ -273,7 +273,7 @@ class Controller(object):
|
||||
def _get_version(dev):
|
||||
if dev.version:
|
||||
return '.'.join(str(x) for x in dev.version)
|
||||
if dev._desc_version:
|
||||
if hasattr(dev, '_desc_version') and dev._desc_version:
|
||||
return '.'.join(str(x) for x in dev._desc_version)
|
||||
return ''
|
||||
|
||||
|
@ -81,10 +81,12 @@ Pane {
|
||||
if (touchCredentialNoCode || (hotpCredential
|
||||
&& !hotpCredentialInCoolDown)
|
||||
|| customPeriodCredentialNoTouch) {
|
||||
if (touchCredential) {
|
||||
|
||||
if (touchCredential && !yubiKey.currentDevice.isNfc) {
|
||||
navigator.snackBar(qsTr("Touch your YubiKey"))
|
||||
}
|
||||
if (hotpCredential) {
|
||||
|
||||
if (hotpCredential && !yubiKey.currentDevice.isNfc) {
|
||||
hotpTouchTimer.start()
|
||||
}
|
||||
|
||||
@ -105,10 +107,17 @@ Pane {
|
||||
entries.updateEntry(resp)
|
||||
} else {
|
||||
if (resp.error_id === 'access_denied') {
|
||||
if (!yubiKey.currentDevice.isNfc) {
|
||||
navigator.snackBarError(qsTr("Touch timed out"))
|
||||
} else {
|
||||
navigator.snackBar(qsTr("Re-tap your YubiKey"))
|
||||
}
|
||||
} else {
|
||||
navigator.snackBarError(navigator.getErrorMessage(
|
||||
resp.error_id))
|
||||
if (resp.error_id === 'no_device_custom_reader') {
|
||||
yubiKey.clearCurrentDeviceAndEntries()
|
||||
}
|
||||
}
|
||||
console.log("calculate failed:", resp.error_id)
|
||||
}
|
||||
@ -143,14 +152,17 @@ Pane {
|
||||
credential.key)
|
||||
|
||||
yubiKey.updateNextCalculateAll()
|
||||
|
||||
navigator.snackBar(
|
||||
qsTr("Account deleted"))
|
||||
} else {
|
||||
navigator.snackBarError(
|
||||
resp.error_id)
|
||||
navigator.getErrorMessage(resp.error_id))
|
||||
console.log("delete failed:", resp.error_id)
|
||||
if (resp.error_id === 'no_device_custom_reader') {
|
||||
yubiKey.clearCurrentDeviceAndEntries()
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -121,6 +121,8 @@ StackView {
|
||||
return qsTr('Failed to read credential from QR code')
|
||||
case 'no_pcscd':
|
||||
return qsTr('Is the pcscd/smart card service running?')
|
||||
case 'no_device_custom_reader':
|
||||
return qsTr('No device found')
|
||||
default:
|
||||
return qsTr('Unknown error')
|
||||
}
|
||||
|
@ -49,6 +49,9 @@ StyledExpansionPanel {
|
||||
} else {
|
||||
navigator.snackBarError(getErrorMessage(resp.error_id))
|
||||
console.log("change password failed:", resp.error_id)
|
||||
if (resp.error_id === 'no_device_custom_reader') {
|
||||
yubiKey.clearCurrentDeviceAndEntries()
|
||||
}
|
||||
}
|
||||
clearPasswordFields()
|
||||
navigator.goToSettings()
|
||||
@ -65,6 +68,9 @@ StyledExpansionPanel {
|
||||
} else {
|
||||
navigator.snackBarError(getErrorMessage(resp.error_id))
|
||||
console.log("set password failed:", resp.error_id)
|
||||
if (resp.error_id === 'no_device_custom_reader') {
|
||||
yubiKey.clearCurrentDeviceAndEntries()
|
||||
}
|
||||
}
|
||||
clearPasswordFields()
|
||||
navigator.goToSettings()
|
||||
@ -83,6 +89,9 @@ StyledExpansionPanel {
|
||||
} else {
|
||||
navigator.snackBarError(getErrorMessage(resp.error_id))
|
||||
console.log("remove password failed:", resp.error_id)
|
||||
if (resp.error_id === 'no_device_custom_reader') {
|
||||
yubiKey.clearCurrentDeviceAndEntries()
|
||||
}
|
||||
}
|
||||
clearPasswordFields()
|
||||
navigator.goToSettings()
|
||||
|
@ -33,7 +33,11 @@ StyledExpansionPanel {
|
||||
resp.error_id))
|
||||
console.log("reset failed:",
|
||||
resp.error_id)
|
||||
if (resp.error_id === 'no_device_custom_reader') {
|
||||
yubiKey.clearCurrentDeviceAndEntries()
|
||||
}
|
||||
}
|
||||
|
||||
navigator.goToSettings()
|
||||
})
|
||||
}
|
||||
|
@ -302,7 +302,12 @@ Python {
|
||||
}
|
||||
|
||||
if (settings.useCustomReader) {
|
||||
if (!currentDevice) {
|
||||
checkReaders(settings.customReaderName, callback)
|
||||
} else if (timeToCalculateAll() && !!currentDevice
|
||||
&& currentDeviceValidated && yubiKey.currentDeviceEnabled("OATH")) {
|
||||
calculateAll()
|
||||
}
|
||||
} else {
|
||||
checkDescriptors(callback)
|
||||
}
|
||||
@ -327,13 +332,18 @@ Python {
|
||||
currentDevice.hasPassword = true
|
||||
currentDeviceValidated = false
|
||||
navigator.goToEnterPasswordIfNotInSettings()
|
||||
} else if (resp.error_id === 'no_device_custom_reader') {
|
||||
navigator.snackBarError(navigator.getErrorMessage(resp.error_id))
|
||||
clearCurrentDeviceAndEntries()
|
||||
} else {
|
||||
clearCurrentDeviceAndEntries()
|
||||
console.log("calculateAll failed:", resp.error_id)
|
||||
if (!settings.useCustomReader) {
|
||||
refreshDevicesDefault()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ccidCalculateAll(callback)
|
||||
|
Loading…
Reference in New Issue
Block a user