Add success: false to change-password error emits.

This commit is contained in:
Richard Lewis 2019-03-03 17:27:57 +02:00 committed by Pavel Djundik
parent 6c10a2a6cf
commit 2ef3e3e5b4

View file

@ -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;