Browse Source

configurable admin account

feature/telegramLogin
Nareshkumar Rao 3 years ago
parent
commit
dfea6ebebc
  1. 8
      app.js

8
app.js

@ -71,12 +71,12 @@ const User = sequelize.define('User', {
});
User.sync().then(() => {
if(!isProduction){
if(process.env.ADMIN_USERNAME && process.env.ADMIN_PASSWORD){
User.create({
telegram: "admin",
hash: bcrypt.hashSync("test", 10),
telegram: process.env.ADMIN_USERNAME,
hash: bcrypt.hashSync(process.env.ADMIN_PASSWORD, 10),
}).catch(e => {
console.log("Couldn't create demo account. Probably exists.");
console.log("Couldn't create admin account. Probably exists.");
});
}
});

Loading…
Cancel
Save