Fix new login location detection
This commit is contained in:
@@ -561,7 +561,7 @@ function checkLoginLocation(user, ip, userAgent) {
|
||||
let loginLocations = user.loginLocations.filter(function (l) { return l.ts > sixMonthsBack; });
|
||||
|
||||
// only stash if we have a real useragent, otherwise warn the user every time
|
||||
if (!simplifiedUserAgent) loginLocations.push(newLoginLocation);
|
||||
if (simplifiedUserAgent) loginLocations.push(newLoginLocation);
|
||||
|
||||
userdb.update(user.id, { loginLocations }, function (error) {
|
||||
if (error) console.error('checkLoginLocation: Failed to update user location.', error);
|
||||
|
||||
Reference in New Issue
Block a user