From ec0e25e5ed674e0124189269f313418b94adce45 Mon Sep 17 00:00:00 2001 From: mantikoros Date: Mon, 25 Jul 2022 18:25:23 -0700 Subject: [PATCH] create user: remove ip check --- functions/src/create-user.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/functions/src/create-user.ts b/functions/src/create-user.ts index 1f413b6d..ab7c8e9a 100644 --- a/functions/src/create-user.ts +++ b/functions/src/create-user.ts @@ -63,10 +63,7 @@ export const createuser = newEndpoint(opts, async (req, auth) => { const deviceUsedBefore = !deviceToken || (await isPrivateUserWithDeviceToken(deviceToken)) - const ipCount = req.ip ? await numberUsersWithIp(req.ip) : 0 - - const balance = - deviceUsedBefore || ipCount > 2 ? SUS_STARTING_BALANCE : STARTING_BALANCE + const balance = deviceUsedBefore ? SUS_STARTING_BALANCE : STARTING_BALANCE const user: User = { id: auth.uid, @@ -113,7 +110,7 @@ const isPrivateUserWithDeviceToken = async (deviceToken: string) => { return !snap.empty } -const numberUsersWithIp = async (ipAddress: string) => { +export const numberUsersWithIp = async (ipAddress: string) => { const snap = await firestore .collection('private-users') .where('initialIpAddress', '==', ipAddress)