Fix new login location detection

This commit is contained in:
Johannes Zellner
2021-05-09 10:07:22 +02:00
parent 91a7a9e43c
commit 7dcc904af9

View File

@@ -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);