From ce4860e5eef101768881bd6cf0c1f3d5cef75851 Mon Sep 17 00:00:00 2001 From: necitboss Date: Sun, 10 Nov 2024 17:47:14 +0300 Subject: [PATCH] kharitonov_bug-fixes --- main/utils/checkAuth.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main/utils/checkAuth.js b/main/utils/checkAuth.js index cebf707..7f00c0c 100644 --- a/main/utils/checkAuth.js +++ b/main/utils/checkAuth.js @@ -1,13 +1,13 @@ import jwt from "jsonwebtoken" -export default (req, res) => { +export default (req, res, next) => { const token = (req.headers.authorization || '') - .replace(/Brarer\s?/, ''); + .replace(/Bearer\s?/, ''); const msg = 'Нет доступа'; if (token){ try { const decoded = jwt.verify(token, 'secret2314'); - req.adminId = decoded.id; + // req.adminId = decoded.id; next(); } catch (err) { return res.status(403).json({