mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 03:16:11 +01:00
fixed custom header authentication
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user