new login mail: minor adjustments to text
This commit is contained in:
+3
-2
@@ -553,13 +553,14 @@ 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, userAgent, country, city };
|
||||
let loginLocations = user.loginLocations.filter(function (l) { return l.ts > sixMonthsBack; });
|
||||
|
||||
loginLocations.push({ ts: Date.now(), ip, userAgent, country, city });
|
||||
loginLocations.push(newLoginLocation);
|
||||
userdb.update(user.id, { loginLocations }, function (error) {
|
||||
if (error) console.error('checkLoginLocation: Failed to update user location.', error);
|
||||
|
||||
mailer.sendNewLoginLocation(user, ip, userAgent, country, city);
|
||||
mailer.sendNewLoginLocation(user, newLoginLocation);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user