Skip to content

Build your personal knowledge base with Trilium Notes

extra init check to provide better error response

zadam5710c9e9972d
diff --git a/src/services/auth.js b/src/services/auth.js
index 74a1ec1ddb..2e6c6bfe96 100644
--- a/src/services/auth.js
+++ b/src/services/auth.js
@@ -79,8 +79,12 @@ function reject(req, res, message) {
}
function checkCredentials(req, res, next) {
+ if (!sqlInit.isDbInitialized()) {
+ res.status(400).send('Database is not initialized yet.');
+ }
+
const header = req.headers['trilium-cred'] || '';
- const auth = new Buffer.from(header, 'base64').toString();console.log("auth", auth);
+ const auth = new Buffer.from(header, 'base64').toString();
const [username, password] = auth.split(/:/);
const dbUsername = optionService.getOption('username');