Disable secret creation when secret is empty
fixes #86 Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
413ad347e4
commit
3bc73a617d
1 changed files with 6 additions and 1 deletions
|
@ -90,6 +90,7 @@
|
||||||
/>
|
/>
|
||||||
</b-form-group>
|
</b-form-group>
|
||||||
<b-button
|
<b-button
|
||||||
|
:disabled="secret.trim().length < 1"
|
||||||
variant="success"
|
variant="success"
|
||||||
@click="createSecret"
|
@click="createSecret"
|
||||||
>
|
>
|
||||||
|
@ -215,6 +216,10 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
// createSecret executes the secret creation after encrypting the secret
|
// createSecret executes the secret creation after encrypting the secret
|
||||||
createSecret() {
|
createSecret() {
|
||||||
|
if (this.secret.trim().length < 1) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
this.securePassword = [...window.crypto.getRandomValues(new Uint8Array(passwordLength))]
|
this.securePassword = [...window.crypto.getRandomValues(new Uint8Array(passwordLength))]
|
||||||
.map(n => passwordCharset[n % passwordCharset.length])
|
.map(n => passwordCharset[n % passwordCharset.length])
|
||||||
.join('')
|
.join('')
|
||||||
|
|
Loading…
Reference in a new issue