Ajout initial des fichiers de la version mysal

This commit is contained in:
Rampeur
2025-08-08 18:34:15 +02:00
parent 29635cdf83
commit 9a534d5a17
30 changed files with 1381 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
const jwt = require("jsonwebtoken");
module.exports.sign = async (user) => {
const token = await jwt.sign(
{ id: user.id, username: user.username, email: user.email },
process.env.JWT_SECRET
);
return token;
};
module.exports.verify = async (token) => {
const decoded = await jwt.verify(token, process.env.JWT_SECRET);
return decoded;
};