server/middleware/authenticate.js
Function authenticate
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const authenticate = (req, res, next) => {
const token = getToken(req);
if (token) {
jwt.verify(token, process.env.SECRET, (error, decoded) => {
if (error) {