Authetication, logger middleware, db create tool

This commit is contained in:
MrFry 2020-04-07 09:26:45 +02:00
parent 5f0b17a0db
commit ebd27f93c1
11 changed files with 164 additions and 94 deletions

View file

@ -125,7 +125,14 @@ function LogReq (req, toFile, sc) {
hostname = 'NOHOST'
Log('req.hostname is undefined! req.hostname: ' + req.hostname, GetColor('redbg'))
}
logEntry += dl + hostname + dl + req.headers['user-agent'] + dl + req.method + dl
logEntry += dl +
hostname + dl +
req.headers['user-agent'] + dl +
req.method + dl
if (req.session && req.session.user) {
logEntry += C('cyan') + req.session.user.id + C() + dl
}
logEntry += GetRandomColor(req.url.split('?')[0]) + req.url