mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
fix csrf path so that it's valid only for current path and not whole (sub)domain
This commit is contained in:
parent
6c7e2f0aa1
commit
001bd1d004
@ -40,7 +40,10 @@ const sql = require('../services/sql');
|
|||||||
const protectedSessionService = require('../services/protected_session');
|
const protectedSessionService = require('../services/protected_session');
|
||||||
const csurf = require('csurf');
|
const csurf = require('csurf');
|
||||||
|
|
||||||
const csrfMiddleware = csurf({ cookie: true });
|
const csrfMiddleware = csurf({
|
||||||
|
cookie: true,
|
||||||
|
path: '' // nothing so cookie is valid only for current path
|
||||||
|
});
|
||||||
|
|
||||||
function apiResultHandler(req, res, result) {
|
function apiResultHandler(req, res, result) {
|
||||||
// if it's an array and first element is integer then we consider this to be [statusCode, response] format
|
// if it's an array and first element is integer then we consider this to be [statusCode, response] format
|
||||||
|
Loading…
x
Reference in New Issue
Block a user