diff --git a/src/server.ts b/src/server.ts index bcd806f..58a5218 100644 --- a/src/server.ts +++ b/src/server.ts @@ -36,12 +36,16 @@ class ServerApplication{ if(setting.cli){ const userAdmin = await getAdmin(this.userController); if(await isAdminFirst(userAdmin)){ - const rl = createReadlineInterface({input:process.stdin,output:process.stdout}); - rl.setPrompt("put admin password : "); - rl.prompt(); - const pw = await new Promise((res:(data:string)=>void,err)=>{ - rl.on('line',(data)=>res(data)); + const rl = createReadlineInterface({ + input:process.stdin, + output:process.stdout }); + const pw = await new Promise((res:(data:string)=>void,err)=>{ + rl.question("put admin password :",(data)=>{ + res(data); + }); + }); + rl.close(); userAdmin.reset_password(pw); } }