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({