mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-03-15 12:20:21 +01:00
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 () {
|
||||
if (!this.user.username) {
|
||||
this.$q.notify({
|
||||
type: 'warning',
|
||||
message: 'Please set a username first.'
|
||||
})
|
||||
return
|
||||
}
|
||||
try {
|
||||
const {data} = await LNbits.api.request(
|
||||
'PUT',
|
||||
|
@ -61,6 +68,7 @@ new Vue({
|
|||
null,
|
||||
{
|
||||
user_id: this.user.id,
|
||||
username: this.user.username,
|
||||
password_old: this.passwordData.oldPassword,
|
||||
password: this.passwordData.newPassword,
|
||||
password_repeat: this.passwordData.newPasswordRepeat
|
||||
|
@ -77,6 +85,13 @@ new Vue({
|
|||
}
|
||||
},
|
||||
showChangePassword: function () {
|
||||
if (!this.user.username) {
|
||||
this.$q.notify({
|
||||
type: 'warning',
|
||||
message: 'Please set a username first.'
|
||||
})
|
||||
return
|
||||
}
|
||||
this.passwordData = {
|
||||
show: true,
|
||||
oldPassword: null,
|
||||
|
|
Loading…
Add table
Reference in a new issue