Asks pin and passphrase if device is not ready

This commit is contained in:
nicolas.dorier 2019-11-24 22:51:13 +09:00
parent 2e0db1a430
commit 287fbc523f
No known key found for this signature in database
GPG key ID: 6618763EF09186FE
2 changed files with 8 additions and 2 deletions

View file

@ -74,12 +74,17 @@ namespace BTCPayServer.Controllers
await websocketHelper.Send("{ \"error\": \"need-device\"}", cancellationToken);
return true;
}
if (deviceEntry.NeedsPinSent is true && pin is null)
if (deviceEntry.Code is HwiErrorCode.DeviceNotInitialized)
{
await websocketHelper.Send("{ \"error\": \"need-initialized\"}", cancellationToken);
return true;
}
if ((deviceEntry.Code is HwiErrorCode.DeviceNotReady || deviceEntry.NeedsPinSent is true) && pin is null)
{
await websocketHelper.Send("{ \"error\": \"need-pin\"}", cancellationToken);
return true;
}
if (deviceEntry.NeedsPassphraseSent is true && password == null)
if ((deviceEntry.Code is HwiErrorCode.DeviceNotReady || deviceEntry.NeedsPassphraseSent is true) && password == null)
{
await websocketHelper.Send("{ \"error\": \"need-passphrase\"}", cancellationToken);
return true;

View file

@ -33,6 +33,7 @@ var vaultui = (function () {
errorWebsockets: new VaultFeedback("failed", "Error of the websocket while connecting to the backend.", "vault-feedback1", "error-websocket"),
bridgeConnected: new VaultFeedback("ok", "BTCPayServer successfully connected to the vault.", "vault-feedback1", "bridge-connected"),
noDevice: new VaultFeedback("failed", "No device connected.", "vault-feedback2", "no-device"),
needInitialized: new VaultFeedback("failed", "The device has not been initialized.", "vault-feedback2", "need-initialized"),
fetchingDevice: new VaultFeedback("?", "Fetching device...", "vault-feedback2", "fetching-device"),
deviceFound: new VaultFeedback("ok", "Device found: {{0}}", "vault-feedback2", "device-selected"),
fetchingXpubs: new VaultFeedback("?", "Fetching public keys...", "vault-feedback3", "fetching-xpubs"),