removed username/password from setup

This commit is contained in:
zadam
2021-12-28 22:59:38 +01:00
parent a910034c96
commit 7e48d214ca
5 changed files with 52 additions and 129 deletions
+2 -4
View File
@@ -12,9 +12,7 @@ function initDocumentOptions() {
optionService.createOption('documentSecret', utils.randomSecureToken(16), false);
}
function initSyncedOptions(username, password) {
optionService.createOption('username', username, true);
function initPassword(username, password) {
optionService.createOption('passwordVerificationSalt', utils.randomSecureToken(32), true);
optionService.createOption('passwordDerivedKeySalt', utils.randomSecureToken(32), true);
@@ -129,7 +127,7 @@ function getKeyboardDefaultOptions() {
module.exports = {
initDocumentOptions,
initSyncedOptions,
initPassword,
initNotSyncedOptions,
initStartupOptions
};
+6 -7
View File
@@ -45,9 +45,7 @@ async function initDbConnection() {
dbReady.resolve();
}
async function createInitialDatabase(username, password, theme) {
log.info("Creating database schema ...");
async function createInitialDatabase() {
if (isDbInitialized()) {
throw new Error("DB is already initialized");
}
@@ -57,9 +55,9 @@ async function createInitialDatabase(username, password, theme) {
let rootNote;
log.info("Creating root note ...");
sql.transactional(() => {
log.info("Creating database schema ...");
sql.executeScript(schema);
require("../becca/becca_loader").load();
@@ -67,6 +65,8 @@ async function createInitialDatabase(username, password, theme) {
const Note = require("../becca/entities/note");
const Branch = require("../becca/entities/branch");
log.info("Creating root note ...");
rootNote = new Note({
noteId: 'root',
title: 'root',
@@ -87,8 +87,7 @@ async function createInitialDatabase(username, password, theme) {
const optionsInitService = require('./options_init');
optionsInitService.initDocumentOptions();
optionsInitService.initSyncedOptions(username, password);
optionsInitService.initNotSyncedOptions(true, { theme });
optionsInitService.initNotSyncedOptions(true, {});
optionsInitService.initStartupOptions();
});