// utils/publicJwt.js
const jwt = require('jsonwebtoken');
const SECRET = process.env.PUBLIC_EVENT_JWT_SECRET || 'default_public_event_secret';

exports.signPublicEventToken = (payload) => {
  const token = jwt.sign(payload, SECRET, { expiresIn: '2h' });
  return token;
};
exports.verifyPublicEventToken = (token) => {
  const decoded = jwt.verify(token, SECRET);
  return decoded;
};
