This commit is contained in:
monoid 2021-10-11 22:51:44 +09:00
parent 65818f1db4
commit cd1d2c85d8

View File

@ -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);
}
}