Fix login location stash

This commit is contained in:
Johannes Zellner
2021-05-04 15:00:09 +02:00
parent f016f3d3e1
commit 5ab925e284

View File

@@ -557,7 +557,7 @@ function checkLoginLocation(user, ip, userAgent) {
// purge potentially old locations where ts > now() - 6 months
const sixMonthsBack = Date.now() - 6 * 30 * 24 * 60 * 60 * 1000;
const newLoginLocation = { ts: Date.now(), ip, simplifiedUserAgent, country, city };
const newLoginLocation = { ts: Date.now(), ip, userAgent: simplifiedUserAgent, country, city };
let loginLocations = user.loginLocations.filter(function (l) { return l.ts > sixMonthsBack; });
loginLocations.push(newLoginLocation);