Skip to content

Commit

Permalink
make passwords editable again! fixes #709
Browse files Browse the repository at this point in the history
  • Loading branch information
tgloeggl committed Aug 9, 2023
1 parent ee7d4aa commit 3c2aec8
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions vueapp/components/Config/ConfigOption.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@

<div class="input-group files-search oc--admin-password">

<input :type="passwordVisible ?'text' : 'password'"
<input :type="passwordVisible ? 'text' : 'password'"
@change="updateHiddenPassword"
@focusin="clearTextFieldIfHidden"
@focusout="fillTextFieldIfHidden"
v-model="password"
:placeholder="setting.placeholder"
>
Expand Down Expand Up @@ -116,7 +118,7 @@ export default {
data() {
return {
password: '',
password: '*****',
passwordVisible: false
}
},
Expand All @@ -129,14 +131,6 @@ export default {
}
},
updated() {
if (!this.passwordVisible && this.setting.type == 'password'
&& this.setting.value)
{
this.password = '*****';
}
},
methods: {
setValue(newValue) {
this.$emit('updateValue', this.setting, newValue);
Expand All @@ -158,6 +152,20 @@ export default {
updateHiddenPassword() {
this.setValue(this.password);
},
clearTextFieldIfHidden()
{
if (!this.passwordVisible && this.password == '*****') {
this.password = '';
}
},
fillTextFieldIfHidden()
{
if (!this.passwordVisible && this.password.length == 0) {
this.password = '*****';
}
}
}
}
Expand Down

0 comments on commit 3c2aec8

Please sign in to comment.