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: fix TS warning by type narrowing
Panagiotis Papadopoulosc36085e5801f
diff --git a/src/routes/index.ts b/src/routes/index.tsindex 5115630a0b..4a26d83871 100644--- a/src/routes/index.ts+++ b/src/routes/index.ts@@ -19,7 +19,7 @@ function index(req: Request, res: Response) {const view = !utils.isElectron() && req.cookies["trilium-device"] === "mobile" ? "mobile" : "desktop";- const csrfToken = req.csrfToken();+ const csrfToken = (typeof req.csrfToken === "function") ? req.csrfToken() : undefined;log.info(`Generated CSRF token ${csrfToken} with secret ${res.getHeader("set-cookie")}`);// We force the page to not be cached since on mobile the CSRF token can be