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 parsing the authentication header with password containing a colon, closes #3916
zadam04caba9f5b05
diff --git a/src/services/auth.js b/src/services/auth.jsindex 331f1d252e..8081cd34c5 100644--- a/src/services/auth.js+++ b/src/services/auth.js@@ -110,8 +110,8 @@ function checkCredentials(req, res, next) {const header = req.headers['trilium-cred'] || '';const auth = new Buffer.from(header, 'base64').toString();- const [username, password] = auth.split(/:/);-+ const colonIndex = auth.indexOf(':');+ const password = colonIndex === -1 ? "" : auth.substr(colonIndex + 1);// username is ignoredif (!passwordEncryptionService.verifyPassword(password)) {