Version 1.1.0 - Refactor + Intergration Backend

This commit is contained in:
2025-07-25 17:56:30 +02:00
parent a59d7a66db
commit 98cdae97c0
58 changed files with 244 additions and 70 deletions

18
src/utils/TokenManager.js Normal file
View File

@@ -0,0 +1,18 @@
function generateToken(userId) {
// Generate a token using the user ID with 32 random bytes
const crypto = require('crypto');
const token = userId + "_" + crypto.randomBytes(32).toString('hex');
return token;
}
function generateSessionId() {
// Generate a session ID using 32 random bytes
const crypto = require('crypto');
const sessionId = "SESSION" + "_" + crypto.randomBytes(32).toString('hex');
return sessionId;
}
module.exports = {generateToken, generateSessionId}