server: remove type cast from change pw

This commit is contained in:
Reto Brunner 2024-04-17 17:53:39 +02:00
parent e61e356f1e
commit 82e4150cc8

View file

@ -546,18 +546,10 @@ function initializeClient(
const hash = Helper.password.hash(p1);
client.setPassword(hash, (success: boolean) => {
const obj = {success: false, error: undefined} as {
success: boolean;
error: string | undefined;
};
if (success) {
obj.success = true;
} else {
obj.error = "update_failed";
}
socket.emit("change-password", obj);
socket.emit("change-password", {
success: success,
error: success ? undefined : "update_failed",
});
});
})
.catch((error: Error) => {