small changes

This commit is contained in:
Nikolai Petukhov
2024-10-12 12:23:25 +03:00
parent 54f6c5c053
commit 51618c8858
6 changed files with 10 additions and 22 deletions

View File

@@ -1,13 +1,12 @@
const jwt = require('jsonwebtoken');
require('dotenv').config();
const TOKEN_KEY = process.env.TOKEN_KEY;
const { TOKEN_KEY } = require('../key')
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