mirror of
https://github.com/thelounge/thelounge
synced 2024-11-10 06:34:21 +00:00
server: remove type cast from change pw
This commit is contained in:
parent
e61e356f1e
commit
82e4150cc8
1 changed files with 4 additions and 12 deletions
|
@ -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) => {
|
||||
|
|
Loading…
Reference in a new issue