fix: check for username before allowing password change (#2239)
This commit is contained in:
parent
4f45781319
commit
59968e38d1
1 changed files with 15 additions and 0 deletions
|
|
@ -54,6 +54,13 @@ new Vue({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
updatePassword: async function () {
|
updatePassword: async function () {
|
||||||
|
if (!this.user.username) {
|
||||||
|
this.$q.notify({
|
||||||
|
type: 'warning',
|
||||||
|
message: 'Please set a username first.'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
const {data} = await LNbits.api.request(
|
const {data} = await LNbits.api.request(
|
||||||
'PUT',
|
'PUT',
|
||||||
|
|
@ -61,6 +68,7 @@ new Vue({
|
||||||
null,
|
null,
|
||||||
{
|
{
|
||||||
user_id: this.user.id,
|
user_id: this.user.id,
|
||||||
|
username: this.user.username,
|
||||||
password_old: this.passwordData.oldPassword,
|
password_old: this.passwordData.oldPassword,
|
||||||
password: this.passwordData.newPassword,
|
password: this.passwordData.newPassword,
|
||||||
password_repeat: this.passwordData.newPasswordRepeat
|
password_repeat: this.passwordData.newPasswordRepeat
|
||||||
|
|
@ -77,6 +85,13 @@ new Vue({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
showChangePassword: function () {
|
showChangePassword: function () {
|
||||||
|
if (!this.user.username) {
|
||||||
|
this.$q.notify({
|
||||||
|
type: 'warning',
|
||||||
|
message: 'Please set a username first.'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
this.passwordData = {
|
this.passwordData = {
|
||||||
show: true,
|
show: true,
|
||||||
oldPassword: null,
|
oldPassword: null,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue