mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-03 09:49:20 +02:00
Optimize updating token activity
This commit is contained in:
parent
448bc823ef
commit
12c9825658
4 changed files with 34 additions and 15 deletions
|
@ -13,11 +13,12 @@ export function authenticate (req: express.Request, res: express.Response, next:
|
|||
res.locals.oauth = { token }
|
||||
res.locals.authenticated = true
|
||||
|
||||
token.lastActivityDate = new Date()
|
||||
token.lastActivityIP = req.ip
|
||||
token.lastActivityDevice = req.header('user-agent')
|
||||
|
||||
UpdateTokenSessionScheduler.Instance.addToUpdate(token)
|
||||
UpdateTokenSessionScheduler.Instance.addToUpdate({
|
||||
id: token.id,
|
||||
lastActivityDate: new Date(),
|
||||
lastActivityIP: req.ip,
|
||||
lastActivityDevice: req.header('user-agent')
|
||||
})
|
||||
|
||||
return next()
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue