From 3359d49161dc2137acb5fd5b5d6d2b1412a9c8b4 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 21 Sep 2020 19:19:55 +0200 Subject: [PATCH] off both passphrase and security key options --- src/domain/session/SessionStatusViewModel.js | 15 +++++++++++++-- src/ui/web/session/SessionStatusView.js | 3 ++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/domain/session/SessionStatusViewModel.js b/src/domain/session/SessionStatusViewModel.js index d6ce464c..9c1b6cde 100644 --- a/src/domain/session/SessionStatusViewModel.js +++ b/src/domain/session/SessionStatusViewModel.js @@ -142,10 +142,21 @@ export class SessionStatusViewModel extends ViewModel { async enterPassphrase(passphrase) { if (passphrase) { try { - await this._session.enableSecretStorage("recoverykey", passphrase); + await this._session.enableSecretStorage("passphrase", passphrase); } catch (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}`); } } } diff --git a/src/ui/web/session/SessionStatusView.js b/src/ui/web/session/SessionStatusView.js index 0a4fea0e..a833c84e 100644 --- a/src/ui/web/session/SessionStatusView.js +++ b/src/ui/web/session/SessionStatusView.js @@ -26,7 +26,8 @@ export class SessionStatusView extends TemplateView { spinner(t, {hidden: vm => !vm.isWaiting}), t.p(vm => vm.statusLabel), 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") : "" ]); }