public 기능 완료
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
// 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;
|
||||
};
|
||||
Reference in New Issue
Block a user