const express = require('express');
const { protect } = require('../middleware/auth');

const router = express.Router();

// Example protected route: only accessible with a valid token
router.get('/secret', protect, (req, res) => {
  res.json({
    message: 'This is a protected route. You are authenticated!',
    user: {
      id: req.user._id,
      name: req.user.name,
      email: req.user.email,
    },
  });
});

module.exports = router;
