mirror of
https://github.com/louislam/dockge.git
synced 2024-11-27 13:14:03 +00:00
Update reset-password.ts
Spaces...
This commit is contained in:
parent
8533d18723
commit
165a944822
1 changed files with 13 additions and 14 deletions
|
@ -68,8 +68,7 @@ export const main = async () => {
|
||||||
console.log("Found password : " + process.env.PASSWORD) ;
|
console.log("Found password : " + process.env.PASSWORD) ;
|
||||||
password = process.env.PASSWORD ;
|
password = process.env.PASSWORD ;
|
||||||
confirmPassword = process.env.PASSWORD ;
|
confirmPassword = process.env.PASSWORD ;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
console.log("No found password: " ) ;
|
console.log("No found password: " ) ;
|
||||||
password = await question("New Password: ");
|
password = await question("New Password: ");
|
||||||
confirmPassword = await question("Confirm New Password: ");
|
confirmPassword = await question("Confirm New Password: ");
|
||||||
|
@ -92,13 +91,13 @@ export const main = async () => {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof Error) {
|
if (e instanceof Error) {
|
||||||
console.error("Error: " + e.message);
|
console.error("Error: " + e.message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await Database.close();
|
await Database.close();
|
||||||
rl.close();
|
rl.close();
|
||||||
|
|
||||||
|
@ -131,17 +130,17 @@ function disconnectAllSocketClients(username : string, password : string) : Prom
|
||||||
});
|
});
|
||||||
socket.on("connect", () => {
|
socket.on("connect", () => {
|
||||||
socket.emit("login", {
|
socket.emit("login", {
|
||||||
username,
|
username,
|
||||||
password,
|
password,
|
||||||
}, (res : BaseRes) => {
|
}, (res : BaseRes) => {
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
console.log("Logged in.");
|
console.log("Logged in.");
|
||||||
socket.emit("disconnectOtherSocketClients");
|
socket.emit("disconnectOtherSocketClients");
|
||||||
} else {
|
} else {
|
||||||
console.warn("Login failed.");
|
console.warn("Login failed.");
|
||||||
console.warn("Please restart the server to disconnect all sessions.");
|
console.warn("Please restart the server to disconnect all sessions.");
|
||||||
}
|
}
|
||||||
socket.close();
|
socket.close();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue