From 89c9d7f90148f312fdc5ed8e0802693fd60c5a39 Mon Sep 17 00:00:00 2001 From: Nikolai Petukhov Date: Sat, 12 Oct 2024 11:21:47 +0300 Subject: [PATCH] fixed error code --- .vscode/launch.json | 26 +++++++++++++++++++ .../enterfront/middlewares/verify.js | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..60cc5a1 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,26 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "pwa-node", + "request": "launch", + "name": "Launch Program", + "skipFiles": [ + "/**" + ], + "program": "${workspaceFolder}/server/index.js" + }, + { + "name": "attach", + "type": "pwa-node", + "request": "attach", + "skipFiles": [ + "/**" + ], + "processId": "${command:PickProcess}" + } + ] +} \ No newline at end of file diff --git a/server/routers/epja-2024-1/enterfront/middlewares/verify.js b/server/routers/epja-2024-1/enterfront/middlewares/verify.js index 74f585b..e0c462c 100644 --- a/server/routers/epja-2024-1/enterfront/middlewares/verify.js +++ b/server/routers/epja-2024-1/enterfront/middlewares/verify.js @@ -6,7 +6,7 @@ function verifyToken(req, res, next) { const token = req.headers['authorization']?.split(' ')[1]; if (!token) { - return res.status(403).send({ message: 'No token provided' }); + return res.status(401).send({ message: 'No token provided' }); } // Verify token