From 59968e38d19ac9ff4a6680fc7627f0404909b089 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Tue, 6 Feb 2024 11:48:13 +0200 Subject: [PATCH] fix: check for `username` before allowing password change (#2239) --- lnbits/static/js/account.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lnbits/static/js/account.js b/lnbits/static/js/account.js index 65c111d3f..cf22716dd 100644 --- a/lnbits/static/js/account.js +++ b/lnbits/static/js/account.js @@ -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,