exports.checkToken = () => {
  return function (req, res, next) {
    const token = req.body.access_token;

    if (token == process.env.TOKEN_SECRET) {
      // console.log(123);
      return next(); // Continue to the next middleware or route
    } else {
      // console.log(456);
      return res.status(404).json({
        success: false,
        message: "Token not found.",
      });
    }
  };
};

