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
chore(server): add logs to debug missing session
Elian Doran63a6f00a47f8
diff --git a/apps/server/src/services/auth.ts b/apps/server/src/services/auth.tsindex 3c9c9c8e60..b076c61c55 100644--- a/apps/server/src/services/auth.ts+++ b/apps/server/src/services/auth.ts@@ -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 difficultfunction 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();