implemented a simple backend for mobile banking

This commit is contained in:
2025-06-02 13:24:10 +05:30
commit c350c591f6
26 changed files with 4060 additions and 0 deletions

15
src/util/jwt.js Normal file
View File

@@ -0,0 +1,15 @@
const jwt = require('jsonwebtoken');
const { jwtSecret } = require('../config/config');
function generateToken(payload, expiresIn = '1h') {
return jwt.sign({ payload }, jwtSecret, { expiresIn });
}
function verifyToken(token) {
return jwt.verify(token, jwtSecret);
}
module.exports = {
generateToken,
verifyToken,
};