Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix password protected notes rejection
zadame5fdd5128a86
diff --git a/package-lock.json b/package-lock.jsonindex c46f2add85..2273eb6239 100644--- a/package-lock.json+++ b/package-lock.json@@ -5,6 +5,7 @@"requires": true,"packages": {"": {+ "name": "trilium","version": "0.53.2","hasInstallScript": true,"license": "AGPL-3.0-only",diff --git a/src/share/routes.js b/src/share/routes.jsindex 095498a082..365bc4fba5 100644--- a/src/share/routes.js+++ b/src/share/routes.js@@ -30,7 +30,7 @@ function addNoIndexHeader(note, res) {}}-function reject(res) {+function requestCredentials(res) {res.setHeader('WWW-Authenticate', 'Basic realm="User Visible Realm", charset="UTF-8"').sendStatus(401);}@@ -55,7 +55,7 @@ function checkNoteAccess(noteId, req, res) {const header = req.header("Authorization");if (!header?.startsWith("Basic ")) {- reject(res);+ requestCredentials(res);return false;}@@ -80,6 +80,8 @@ function register(router) {}if (!checkNoteAccess(note.noteId, req, res)) {+ requestCredentials(res);+return;}