Fix bug where accounts.js tries to create admin account before database is initialized

main
sudoer777 2021-11-26 14:49:08 -07:00
parent 238a22e597
commit d2d6bbc514
2 changed files with 4 additions and 3 deletions

View File

@ -27,7 +27,7 @@ async function checkForAdminAccount() {
console.log("Created temp admin account 'admin@example.com' with password 'admin'.");
}
}
checkForAdminAccount();
database.initializationStatus.then(() => checkForAdminAccount());
passport.use(new localStrategy({

View File

@ -36,10 +36,11 @@ async function checkForDatabaseInitialization() {
await Initialize();
}
}
checkForDatabaseInitialization();
const initializationStatus = checkForDatabaseInitialization();
exports.executeQuery = executeQuery;
exports.executeQuery = executeQuery;
exports.initializationStatus = initializationStatus;