Update config variables and add nodemailer's ones
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
const jwt = require('jsonwebtoken');
|
||||
const { jwt_secret } = require('../config/config');
|
||||
const { jwtSecret } = require('../config/config');
|
||||
|
||||
function authenticate(req, res, next) {
|
||||
const token = req.get('Authorization');
|
||||
|
||||
if (token) {
|
||||
jwt.verify(token, jwt_secret, (err, decoded) => {
|
||||
jwt.verify(token, jwtSecret, (err, decoded) => {
|
||||
if (err) return res.status(401).json(err);
|
||||
req.decoded = decoded;
|
||||
next();
|
||||
|
||||
Reference in New Issue
Block a user