From 99dccd9e902a9b49abaffb90f3dacd95f9c02ab3 Mon Sep 17 00:00:00 2001 From: Huzaifa Azim Date: Fri, 23 Feb 2024 18:10:09 +0500 Subject: [PATCH] reset-password-issue-4518 --- extra/reset-password.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extra/reset-password.js b/extra/reset-password.js index 3b40e93e..b87d90f1 100644 --- a/extra/reset-password.js +++ b/extra/reset-password.js @@ -8,6 +8,7 @@ const User = require("../server/model/user"); const { io } = require("socket.io-client"); const { localWebSocketURL } = require("../server/config"); const args = require("args-parser")(process.argv); + const rl = readline.createInterface({ input: process.stdin, output: process.stdout @@ -19,10 +20,10 @@ const main = async () => { } console.log("Connecting the database"); - Database.initDataDir(args); - await Database.connect(false, false, true); try { + Database.initDataDir(args); + await Database.connect(false, false, true); // No need to actually reset the password for testing, just make sure no connection problem. It is ok for now. if (!process.env.TEST_BACKEND) { const user = await R.findOne("user");