1const jwt = require('jsonwebtoken');
4 * Verify agent JWT token signed with AGENT_SIGN_KEY
5 * @param {string} token - JWT token from agent
6 * @returns {object|null} - Decoded payload or null if invalid
8function verifyTenantJwt(token) {
9 if (!token) return null;
12 const decoded = jwt.verify(token, process.env.AGENT_SIGN_KEY);
15 console.error('JWT verification failed:', err.message);
20module.exports = { verifyTenantJwt };