feat: add passphrase support
This commit is contained in:
parent
739646f702
commit
d08b7455e7
2 changed files with 39 additions and 10 deletions
|
|
@ -428,6 +428,31 @@
|
||||||
</template>
|
</template>
|
||||||
</q-input>
|
</q-input>
|
||||||
<br />
|
<br />
|
||||||
|
<q-toggle
|
||||||
|
label="Passphrase (optional)"
|
||||||
|
color="secodary"
|
||||||
|
v-model="hww.hasPassphrase"
|
||||||
|
></q-toggle>
|
||||||
|
<br />
|
||||||
|
<q-input
|
||||||
|
v-if="hww.hasPassphrase"
|
||||||
|
v-model.trim="hww.passphrase"
|
||||||
|
filled
|
||||||
|
:type="hww.showPassphrase ? 'text' : 'password'"
|
||||||
|
filled
|
||||||
|
dense
|
||||||
|
label="Passphrase"
|
||||||
|
>
|
||||||
|
<template v-slot:append>
|
||||||
|
<q-icon
|
||||||
|
:name="hww.showPassphrase ? 'visibility' : 'visibility_off'"
|
||||||
|
class="cursor-pointer"
|
||||||
|
@click="hww.showPassphrase = !hww.showPassphrase"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</q-input>
|
||||||
|
<q-separator></q-separator>
|
||||||
|
<br />
|
||||||
<span>Enter new password (8 numbers/letters)</span>
|
<span>Enter new password (8 numbers/letters)</span>
|
||||||
<q-input
|
<q-input
|
||||||
v-model.trim="hww.password"
|
v-model.trim="hww.password"
|
||||||
|
|
@ -453,15 +478,7 @@
|
||||||
type="password"
|
type="password"
|
||||||
label="Confirm Password"
|
label="Confirm Password"
|
||||||
></q-input>
|
></q-input>
|
||||||
<br /><br />
|
<br />
|
||||||
<q-badge
|
|
||||||
color="pink"
|
|
||||||
text-color="black"
|
|
||||||
class="text-subtitle2"
|
|
||||||
multi-line
|
|
||||||
>
|
|
||||||
For test purposes only. Do not enter word list with real funds!!!
|
|
||||||
</q-badge>
|
|
||||||
<q-separator></q-separator>
|
<q-separator></q-separator>
|
||||||
<q-badge
|
<q-badge
|
||||||
color="pink"
|
color="pink"
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,9 @@ async function serialSigner(path) {
|
||||||
showPassword: false,
|
showPassword: false,
|
||||||
mnemonic: null,
|
mnemonic: null,
|
||||||
showMnemonic: false,
|
showMnemonic: false,
|
||||||
|
passphrase: null,
|
||||||
|
showPassphrase: false,
|
||||||
|
hasPassphrase: false,
|
||||||
authenticated: false,
|
authenticated: false,
|
||||||
showPasswordDialog: false,
|
showPasswordDialog: false,
|
||||||
showConfigDialog: false,
|
showConfigDialog: false,
|
||||||
|
|
@ -797,9 +800,17 @@ async function serialSigner(path) {
|
||||||
},
|
},
|
||||||
hwwRestore: async function () {
|
hwwRestore: async function () {
|
||||||
try {
|
try {
|
||||||
|
let mnemonicWithPassphrase = this.hww.mnemonic
|
||||||
|
if (
|
||||||
|
this.hww.hasPassphrase &&
|
||||||
|
this.hww.passphrase &&
|
||||||
|
this.hww.passphrase.length
|
||||||
|
) {
|
||||||
|
mnemonicWithPassphrase += '/' + this.hww.passphrase
|
||||||
|
}
|
||||||
await this.sendCommandSecure(COMMAND_RESTORE, [
|
await this.sendCommandSecure(COMMAND_RESTORE, [
|
||||||
this.hww.password,
|
this.hww.password,
|
||||||
this.hww.mnemonic
|
mnemonicWithPassphrase
|
||||||
])
|
])
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.$q.notify({
|
this.$q.notify({
|
||||||
|
|
@ -811,6 +822,7 @@ async function serialSigner(path) {
|
||||||
} finally {
|
} finally {
|
||||||
this.hww.showRestoreDialog = false
|
this.hww.showRestoreDialog = false
|
||||||
this.hww.mnemonic = null
|
this.hww.mnemonic = null
|
||||||
|
this.hww.passphrase = null
|
||||||
this.hww.showMnemonic = false
|
this.hww.showMnemonic = false
|
||||||
this.hww.password = null
|
this.hww.password = null
|
||||||
this.hww.confirmedPassword = null
|
this.hww.confirmedPassword = null
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue