mirror of
https://github.com/lnbits/lnbits.git
synced 2025-10-09 20:12:34 +02:00
fix: check for username
before allowing password change (#2239)
This commit is contained in:
@@ -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,
|
||||||
|
Reference in New Issue
Block a user