Skip to content

Build your personal knowledge base with Trilium Notes

better error when password is not set, #2685

zadam4dd3fd9674ed
diff --git a/src/services/auth.js b/src/services/auth.js
index 26e5aecead..3b36fa51cb 100644
--- a/src/services/auth.js
+++ b/src/services/auth.js
@@ -94,6 +94,12 @@ function reject(req, res, message) {
function checkCredentials(req, res, next) {
if (!sqlInit.isDbInitialized()) {
res.status(400).send('Database is not initialized yet.');
+ return;
+ }
+
+ if (!passwordService.isPasswordSet()) {
+ res.status(400).send('Password has not been set yet. Please set a password and repeat the action');
+ return;
}
const header = req.headers['trilium-cred'] || '';