mirror of
https://github.com/thelounge/thelounge
synced 2024-11-11 15:07:14 +00:00
Add success: false to change-password error emits.
This commit is contained in:
parent
6c10a2a6cf
commit
2ef3e3e5b4
1 changed files with 3 additions and 1 deletions
|
@ -426,6 +426,7 @@ function initializeClient(socket, client, token, lastMessage, openChannel) {
|
|||
if (typeof p1 === "undefined" || p1 === "" || p1 !== p2) {
|
||||
socket.emit("change-password", {
|
||||
error: "",
|
||||
success: false,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
@ -436,6 +437,7 @@ function initializeClient(socket, client, token, lastMessage, openChannel) {
|
|||
if (!matching) {
|
||||
socket.emit("change-password", {
|
||||
error: "password_incorrect",
|
||||
success: false,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
@ -443,7 +445,7 @@ function initializeClient(socket, client, token, lastMessage, openChannel) {
|
|||
const hash = Helper.password.hash(p1);
|
||||
|
||||
client.setPassword(hash, (success) => {
|
||||
const obj = {};
|
||||
const obj = {success: false};
|
||||
|
||||
if (success) {
|
||||
obj.success = true;
|
||||
|
|
Loading…
Reference in a new issue