exports.getSecret = async (req, res) => {
  try {
    res.json({
      message: `Welcome ${req.user.name}, you have accessed a protected backend route.`,
      user: {
        id: req.user._id,
        name: req.user.name,
        email: req.user.email,
      },
    });
  } catch (err) {
    res.status(500).json({ message: err.message });
  }
};
