diff --git a/.vscode/launch.json b/.vscode/launch.json index 810f84749..07248c0fb 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,19 +1,24 @@ { "version": "0.2.0", "configurations": [ + // nodemon should be installed globally, use npm i -g nodemon { - "type": "node", + "console": "integratedTerminal", + "internalConsoleOptions": "neverOpen", + "name": "nodemon start-server", + "program": "${workspaceFolder}/src/www", "request": "launch", - "name": "start-server", - "skipFiles": [ - "/**" - ], + "restart": true, + "runtimeExecutable": "nodemon", "env": { "TRILIUM_ENV": "dev", "TRILIUM_DATA_DIR": "./data" }, + "skipFiles": [ + "/**" + ], + "type": "node", "outputCapture": "std", - "program": "${workspaceFolder}/src/www" - } + }, ] } \ No newline at end of file diff --git a/src/routes/custom.js b/src/routes/custom.js index 077c730cd..f32f7445f 100644 --- a/src/routes/custom.js +++ b/src/routes/custom.js @@ -19,7 +19,7 @@ function handleRequest(req, res) { continue; } - const regex = new RegExp(attr.value); + const regex = new RegExp(`^${attr.value}$`); let match; try { diff --git a/src/routes/login.js b/src/routes/login.js index 9dc9075e7..480ffae86 100644 --- a/src/routes/login.js +++ b/src/routes/login.js @@ -76,7 +76,7 @@ function login(req, res) { // note that logged IP address is usually meaningless since the traffic should come from a reverse proxy log.info(`WARNING: Wrong password from ${req.ip}, rejecting.`); - res.render('login', { + res.status(401).render('login', { failedAuth: true, assetPath: assetPath });