mirror of https://github.com/keeweb/keeweb
fixed YubiKey errors display
parent
9c18e2877b
commit
49d46cfedc
|
@ -686,5 +686,6 @@
|
|||
"yubiKeyTouchRequestedHeader": "Touch your YubiKey",
|
||||
"yubiKeyTouchRequestedBody": "Please touch your YubiKey with serial number {}",
|
||||
"yubiKeyDisabledErrorHeader": "USB is disabled",
|
||||
"yubiKeyDisabledErrorBody": "YubiKey is required to open this file, please enable USB devices in settings."
|
||||
"yubiKeyDisabledErrorBody": "YubiKey is required to open this file, please enable USB devices in settings.",
|
||||
"yubiKeyErrorWithCode": "YubiKey error, code {}."
|
||||
}
|
||||
|
|
|
@ -691,7 +691,7 @@ class OpenView extends View {
|
|||
Alerts.error({
|
||||
header: Locale.openError,
|
||||
body: Locale.openErrorDescription,
|
||||
pre: err.toString()
|
||||
pre: this.errorToString(err)
|
||||
});
|
||||
}
|
||||
} else {
|
||||
|
@ -1027,7 +1027,7 @@ class OpenView extends View {
|
|||
Alerts.error({
|
||||
header: Locale.openError,
|
||||
body: Locale.openErrorDescription,
|
||||
pre: err.toString()
|
||||
pre: this.errorToString(err)
|
||||
});
|
||||
}
|
||||
this.otpDevice = null;
|
||||
|
@ -1071,6 +1071,17 @@ class OpenView extends View {
|
|||
view: chalRespView
|
||||
});
|
||||
}
|
||||
|
||||
errorToString(err) {
|
||||
const str = err.toString();
|
||||
if (str !== {}.toString()) {
|
||||
return str;
|
||||
}
|
||||
if (err.ykError && err.code) {
|
||||
return Locale.yubiKeyErrorWithCode.replace('{}', err.code);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
export { OpenView };
|
||||
|
|
Loading…
Reference in New Issue