Fix login location stash
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user