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

const router = express.Router();

// Simple protected route for verifying the JWT middleware works
router.get('/check', protect, (req, res) => {
  res.json({
    message: 'Protected route is working',
    user: {
      id: req.user._id,
      name: req.user.name,
      username: req.user.username,
      role: req.user.role,
    },
  });
});

module.exports = router;
