off both passphrase and security key options

This commit is contained in:
Bruno Windels 2020-09-21 19:19:55 +02:00
parent f84f06758c
commit 3359d49161
2 changed files with 15 additions and 3 deletions

View File

@ -142,10 +142,21 @@ export class SessionStatusViewModel extends ViewModel {
async enterPassphrase(passphrase) { async enterPassphrase(passphrase) {
if (passphrase) { if (passphrase) {
try { try {
await this._session.enableSecretStorage("recoverykey", passphrase); await this._session.enableSecretStorage("passphrase", passphrase);
} catch (err) { } catch (err) {
console.error(err); console.error(err);
alert(`Could not set up secret storage: ${err.message}`); alert(`Could not set up secret storage with passphrase: ${err.message}`);
}
}
}
async enterSecurityKey(securityKey) {
if (securityKey) {
try {
await this._session.enableSecretStorage("recoverykey", securityKey);
} catch (err) {
console.error(err);
alert(`Could not set up secret storage with securityKey: ${err.message}`);
} }
} }
} }

View File

@ -26,7 +26,8 @@ export class SessionStatusView extends TemplateView {
spinner(t, {hidden: vm => !vm.isWaiting}), spinner(t, {hidden: vm => !vm.isWaiting}),
t.p(vm => vm.statusLabel), t.p(vm => vm.statusLabel),
t.if(vm => vm.isConnectNowShown, t.createTemplate(t => t.button({onClick: () => vm.connectNow()}, "Retry now"))), t.if(vm => vm.isConnectNowShown, t.createTemplate(t => t.button({onClick: () => vm.connectNow()}, "Retry now"))),
t.if(vm => vm.isSecretStorageShown, t.createTemplate(t => t.button({onClick: () => vm.enterPassphrase(prompt("Security key"))}, "Enter security key"))), t.if(vm => vm.isSecretStorageShown, t.createTemplate(t => t.button({onClick: () => vm.enterPassphrase(prompt("Passphrase"))}, "Enter passphrase"))),
t.if(vm => vm.isSecretStorageShown, t.createTemplate(t => t.button({onClick: () => vm.enterSecurityKey(prompt("Security key"))}, "Enter security key"))),
window.DEBUG ? t.button({id: "showlogs"}, "Show logs") : "" window.DEBUG ? t.button({id: "showlogs"}, "Show logs") : ""
]); ]);
} }