import jwt from 'jsonwebtoken';
export function signAccessToken(payload, secret, expiresIn = '24h') {
    return jwt.sign(payload, secret, { expiresIn });
}
export function verifyAccessToken(token, secret) {
    const decoded = jwt.verify(token, secret);
    return { userId: decoded.userId, role: decoded.role };
}
export function signRefreshToken(payload, secret, expiresIn = '30d') {
    return jwt.sign(payload, secret, { expiresIn });
}
export function verifyRefreshToken(token, secret) {
    const decoded = jwt.verify(token, secret);
    return { sessionId: decoded.sessionId, userId: decoded.userId };
}
//# sourceMappingURL=jwt.js.map