Skip to content

Commit

Permalink
kharitonov_bug-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
necitboss committed Nov 10, 2024
1 parent 62db372 commit ce4860e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main/utils/checkAuth.js
Original file line number Diff line number Diff line change
@@ -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({
Expand Down

0 comments on commit ce4860e

Please sign in to comment.