mirror of
https://github.com/zadam/trilium.git
synced 2025-11-07 03:06:37 +08:00
chore(server): add logs to debug missing session
This commit is contained in:
parent
1a54a17b0d
commit
63a6f00a47
1 changed files with 2 additions and 0 deletions
|
|
@ -64,6 +64,7 @@ function checkAuth(req: Request, res: Response, next: NextFunction) {
|
|||
// currently, we're doing that for file upload because handling form data seems to be difficult
|
||||
function checkApiAuthOrElectron(req: Request, res: Response, next: NextFunction) {
|
||||
if (!req.session.loggedIn && !isElectron && !noAuthentication) {
|
||||
console.warn(`Missing session with ID '${req.sessionID}'.`);
|
||||
reject(req, res, "Logged in session not found");
|
||||
} else {
|
||||
next();
|
||||
|
|
@ -72,6 +73,7 @@ function checkApiAuthOrElectron(req: Request, res: Response, next: NextFunction)
|
|||
|
||||
function checkApiAuth(req: Request, res: Response, next: NextFunction) {
|
||||
if (!req.session.loggedIn && !noAuthentication) {
|
||||
console.warn(`Missing session with ID '${req.sessionID}'.`);
|
||||
reject(req, res, "Logged in session not found");
|
||||
} else {
|
||||
next();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue