Include complete API and frontend sources for unified deployment

This commit is contained in:
Vladimir Kutkovoy committed 2026-11-18 07:44:20 +00:00
1 parent 627b0ae60e
commit d8fcae32b0
93 files changed
+53270 -3

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
import jwt from 'jsonwebtoken';
const issuer = 'HackathonApp';
const audience = process.env.WEB_SERVICE;
export default {
generate(payload = {}, options = {}) {
if (!payload.iat) payload.iat = Math.round(+new Date() / 1000);
return {
jwt: jwt.sign(payload, process.env.JWT_KEY, { issuer, audience, ...options }),
iat: payload.iat,
};
},
verify(key) {
return jwt.verify(key, process.env.JWT_KEY, { issuer, audience });
},
};