Initial commit: IT Nexus Web-App
This commit is contained in:
14
backend/src/config/jwt.js
Normal file
14
backend/src/config/jwt.js
Normal file
@@ -0,0 +1,14 @@
|
||||
require('dotenv').config();
|
||||
|
||||
const JWT_CONFIG = {
|
||||
secret: process.env.JWT_SECRET || 'default-secret-change-in-production',
|
||||
expiresIn: process.env.JWT_EXPIRATION || '8h',
|
||||
algorithm: 'HS256'
|
||||
};
|
||||
|
||||
// Validate that JWT_SECRET is set
|
||||
if (!process.env.JWT_SECRET) {
|
||||
console.warn('⚠️ WARNING: JWT_SECRET not set in .env file. Using default secret (INSECURE!)');
|
||||
}
|
||||
|
||||
module.exports = JWT_CONFIG;
|
||||
Reference in New Issue
Block a user