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){ if(setting.cli){
const userAdmin = await getAdmin(this.userController); const userAdmin = await getAdmin(this.userController);
if(await isAdminFirst(userAdmin)){ if(await isAdminFirst(userAdmin)){
const rl = createReadlineInterface({input:process.stdin,output:process.stdout}); const rl = createReadlineInterface({
rl.setPrompt("put admin password : "); input:process.stdin,
rl.prompt(); output:process.stdout
const pw = await new Promise((res:(data:string)=>void,err)=>{
rl.on('line',(data)=>res(data));
}); });
const pw = await new Promise((res:(data:string)=>void,err)=>{
rl.question("put admin password :",(data)=>{
res(data);
});
});
rl.close();
userAdmin.reset_password(pw); userAdmin.reset_password(pw);
} }
} }