Allow setting visitor IP when registering event through API
This commit is contained in:
1 parent
784237bfab
commit
ebb29b8207
3 files changed
+5
-2
No files matched your search
+1
-1
@@ -123,7 +123,7 @@ export async function getLocation(ip, req) {
|
||||
|
||||
export async function getClientInfo(req: NextApiRequestCollect, { screen }) {
|
||||
const userAgent = req.headers['user-agent'];
|
||||
const ip = getIpAddress(req);
|
||||
const ip = req.body.payload.ip || getIpAddress(req);
|
||||
const location = await getLocation(ip, req);
|
||||
const country = location?.country;
|
||||
const subdivision1 = location?.subdivision1;
|
||||
|
||||
Reference in new issue
Block a user