created API For Aplication Absensi

This commit is contained in:
2025-10-14 14:08:11 +07:00
commit 96d206d892
56 changed files with 6533 additions and 0 deletions

15
app/helpers/token.js Normal file
View File

@@ -0,0 +1,15 @@
const jwt = require('jsonwebtoken');
const dotenv = require('dotenv');
dotenv.config();
module.exports = {
createToken: (payload) => {
return jwt.sign(payload, process.env.JWT_SECRET_KEY, {
expiresIn: '1d',
});
},
validateToken: (token) => {
return jwt.verify(token, process.env.JWT_SECRET_KEY);
},
};