Skip to content

Commit bca0009

Browse files
committed
Security Improvements
1 parent 94b5295 commit bca0009

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

index.js

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,33 @@ const handlebarsConfig_INIT = require('./config/handlebarsConfig');
55
const expressConfig_INIT = require('./config/expressConfig');
66
const mongooseConfig_INIT = require('./config/mongooseConfig');
77
const routes = require('./router');
8+
const dbConfig = require('./database/config')
89
mongooseConfig_INIT();
910
handlebarsConfig_INIT(app);
10-
expressConfig_INIT(app,express);
11+
expressConfig_INIT(app, express);
1112

1213
app.use(routes);
1314

1415

15-
app.listen(PORT,() => {
16+
app.listen(PORT, () => {
1617
console.log('Server is running on port ' + PORT);
18+
19+
/// IMPORTANT SECURITY CHECK ///
20+
21+
const defaultJsonWebToken = dbConfig.JWT.SECRET_TOKEN === 'SECRET_MESSAGE';
22+
23+
if (defaultJsonWebToken) {
24+
console.warn(`[!] Important Security Notice: Before deploying this site in a production environment, it is crucial to replace the default JWT token with a highly secure and unique secret token that only you should be aware of. Failing to do so could pose a significant security risk. Protect your application by setting a strong, secret key.
25+
`);
26+
console.warn(`[!] Important Security Notice: Before deploying this site in a production environment, it is crucial to replace the default JWT token with a highly secure and unique secret token that only you should be aware of. Failing to do so could pose a significant security risk. Protect your application by setting a strong, secret key.
27+
`);
28+
console.warn(`[!] Important Security Notice: Before deploying this site in a production environment, it is crucial to replace the default JWT token with a highly secure and unique secret token that only you should be aware of. Failing to do so could pose a significant security risk. Protect your application by setting a strong, secret key.
29+
`);
30+
console.warn(`[!] Important Security Notice: Before deploying this site in a production environment, it is crucial to replace the default JWT token with a highly secure and unique secret token that only you should be aware of. Failing to do so could pose a significant security risk. Protect your application by setting a strong, secret key.
31+
`);
32+
console.warn(`[!] Important Security Notice: Before deploying this site in a production environment, it is crucial to replace the default JWT token with a highly secure and unique secret token that only you should be aware of. Failing to do so could pose a significant security risk. Protect your application by setting a strong, secret key.
33+
`);
34+
console.warn(`[!] Important Security Notice: Before deploying this site in a production environment, it is crucial to replace the default JWT token with a highly secure and unique secret token that only you should be aware of. Failing to do so could pose a significant security risk. Protect your application by setting a strong, secret key.
35+
`);
36+
}
1737
})

0 commit comments

Comments
 (0)