disables per-user IP limit by default
This commit is contained in:
@@ -136,7 +136,9 @@ export function authenticate(token: string, ip: string) {
|
||||
if (!user.ip.includes(ip)) user.ip.push(ip);
|
||||
|
||||
// If too many IPs are associated with the user, disable the account.
|
||||
if (user.ip.length > MAX_IPS_PER_USER && user.type !== "special") {
|
||||
const ipLimit =
|
||||
user.type === "special" || !MAX_IPS_PER_USER ? Infinity : MAX_IPS_PER_USER;
|
||||
if (user.ip.length > ipLimit) {
|
||||
disableUser(token, "Too many IP addresses associated with this token.");
|
||||
return;
|
||||
}
|
||||
@@ -200,7 +202,7 @@ async function flushUsers() {
|
||||
if (numUpdates === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
await usersRef.update(updates);
|
||||
logger.info(
|
||||
{ users: Object.keys(updates).length },
|
||||
|
||||
Reference in New Issue
Block a user