mirror of
https://github.com/umami-software/umami.git
synced 2026-02-19 20:15:41 +01:00
add cookie. add city database
This commit is contained in:
parent
5a8464e4e0
commit
63531f8753
3 changed files with 9 additions and 4 deletions
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable no-console */
|
||||
import { parseToken } from 'next-basics';
|
||||
import { validate } from 'uuid';
|
||||
import { uuid } from 'lib/crypto';
|
||||
|
|
@ -45,8 +46,10 @@ export async function getSession(req) {
|
|||
throw new Error(`Website not found: ${website_uuid}`);
|
||||
}
|
||||
|
||||
const ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
|
||||
const { userAgent, browser, os, country, device } = await getClientInfo(req, payload);
|
||||
// const ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
|
||||
const { userAgent, browser, os, ip, country, device } = await getClientInfo(req, payload);
|
||||
|
||||
console.log('ip:', ip);
|
||||
|
||||
let session_uuid = uuid(websiteId, hostname, ip, userAgent);
|
||||
if (process.env.CROSSDOMAIN_TRACKING) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue