mirror of
https://github.com/Luzifer/ots.git
synced 2024-12-11 16:44:38 -05:00
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
@ -90,6 +90,7 @@
|
||||
/>
|
||||
</b-form-group>
|
||||
<b-button
|
||||
:disabled="secret.trim().length < 1"
|
||||
variant="success"
|
||||
@click="createSecret"
|
||||
>
|
||||
@ -215,6 +216,10 @@ export default {
|
||||
methods: {
|
||||
// createSecret executes the secret creation after encrypting the secret
|
||||
createSecret() {
|
||||
if (this.secret.trim().length < 1) {
|
||||
return false
|
||||
}
|
||||
|
||||
this.securePassword = [...window.crypto.getRandomValues(new Uint8Array(passwordLength))]
|
||||
.map(n => passwordCharset[n % passwordCharset.length])
|
||||
.join('')
|
||||
|
Loading…
Reference in New Issue
Block a user