Track recently active and signin times (#663)

* Track recently active and signin times

* Trust proxy headers in production
This commit is contained in:
Tom Moor
2018-06-04 19:07:56 -07:00
committed by GitHub
parent 1977278426
commit 53a0f423c3
6 changed files with 62 additions and 0 deletions

View File

@ -62,6 +62,9 @@ router.get('slack.callback', async ctx => {
await team.createFirstCollection(user.id);
}
// not awaiting the promise here so that the request is not blocked
user.updateSignedIn(ctx.request.ip);
ctx.cookies.set('lastSignedIn', 'slack', {
httpOnly: false,
expires: new Date('2100'),