Update config variables and add nodemailer's ones

This commit is contained in:
2020-08-29 10:48:21 +02:00
parent f8af75d7d3
commit 2b4832a4f7
6 changed files with 22 additions and 10 deletions

View File

@@ -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();