fixed custom header authentication

This commit is contained in:
zadam
2021-02-07 21:50:34 +01:00
parent bed7bdfd00
commit be65e2e62f
5 changed files with 19 additions and 22 deletions

View File

@@ -79,8 +79,7 @@ function reject(req, res, message) {
function checkCredentials(req, res, next) {
const header = req.headers['trilium-cred'] || '';
const token = header.split(/\s+/).pop() || '';
const auth = new Buffer.from(token, 'base64').toString();
const auth = new Buffer.from(header, 'base64').toString();console.log("auth", auth);
const [username, password] = auth.split(/:/);
const dbUsername = optionService.getOption('username');