const jwt = require('jsonwebtoken');
const CustomAuthorization = function (req) {
  const authHeader = req.headers['authorization'];
  const token = authHeader && authHeader.split(' ')[1];

  if (!token) {
    return null;
  }

  // Verify the token with the same secret key
  return jwt.verify(token, 'secret-key');
};
module.exports = { CustomAuthorization };
