mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Removed ip address logging
This commit is contained in:
parent
c1feb28f86
commit
168a36b538
6 changed files with 17 additions and 27 deletions
|
@ -53,7 +53,7 @@ function setup(data: SubmoduleData): any {
|
|||
})
|
||||
})
|
||||
|
||||
app.post('/getpw', function(req: Request, res: any) {
|
||||
app.post('/getpw', function (req: Request, res: any) {
|
||||
logger.LogReq(req)
|
||||
|
||||
const requestingUser = req.session.user
|
||||
|
@ -111,13 +111,9 @@ function setup(data: SubmoduleData): any {
|
|||
app.post('/login', (req: Request, res: any) => {
|
||||
logger.LogReq(req)
|
||||
const pw = req.body.pw
|
||||
? req.body.pw
|
||||
.replace(/'/g, '')
|
||||
.replace(/"/g, '')
|
||||
.replace(/;/g, '')
|
||||
? req.body.pw.replace(/'/g, '').replace(/"/g, '').replace(/;/g, '')
|
||||
: false
|
||||
const isScript = req.body.script
|
||||
const ip = req.headers['cf-connecting-ip'] || req.connection.remoteAddress
|
||||
const user: User = dbtools.Select(userDB, 'users', {
|
||||
pw: pw,
|
||||
})[0]
|
||||
|
@ -156,7 +152,7 @@ function setup(data: SubmoduleData): any {
|
|||
'users',
|
||||
{
|
||||
loginCount: user.loginCount + 1,
|
||||
lastIP: ip,
|
||||
lastIP: '0.0.0.0',
|
||||
lastLogin: utils.GetDateString(),
|
||||
},
|
||||
{
|
||||
|
@ -166,7 +162,7 @@ function setup(data: SubmoduleData): any {
|
|||
|
||||
dbtools.Insert(userDB, 'sessions', {
|
||||
id: sessionID,
|
||||
ip: ip,
|
||||
ip: '0.0.0.0',
|
||||
userID: user.id,
|
||||
isScript: isScript ? 1 : 0,
|
||||
createDate: utils.GetDateString(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue