Initial commit

This commit is contained in:
2026-09-16 17:36:46 +05:30
commit c9f429d123
117 changed files with 14145 additions and 0 deletions

12
server/utils/jwt.js Normal file
View File

@@ -0,0 +1,12 @@
const jwt = require('jsonwebtoken');
const generateToken = (userId, role) => {
return jwt.sign(
{ id: userId, role },
process.env.JWT_SECRET || 'guitar_ecommerce_super_secret_jwt_key_2026',
{ expiresIn: process.env.JWT_EXPIRE || '30d' }
);
};
module.exports = { generateToken };