mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 07:07:17 +01:00
Updated send logic.
This commit is contained in:
parent
b72232dcac
commit
c0a67dadd5
7 changed files with 101 additions and 67 deletions
|
|
@ -132,7 +132,7 @@ export async function getLocation(ip: string, req: NextApiRequestCollect) {
|
|||
}
|
||||
|
||||
export async function getClientInfo(req: NextApiRequestCollect) {
|
||||
const userAgent = req.headers['user-agent'];
|
||||
const userAgent = req.body?.payload?.userAgent || req.headers['user-agent'];
|
||||
const ip = req.body?.payload?.ip || getIpAddress(req);
|
||||
const location = await getLocation(ip, req);
|
||||
const country = location?.country;
|
||||
|
|
|
|||
|
|
@ -42,6 +42,24 @@ export async function getSession(req: NextApiRequestCollect): Promise<SessionDat
|
|||
const sessionId = uuid(websiteId, hostname, ip, userAgent);
|
||||
const visitId = uuid(sessionId, visitSalt());
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('SESSION', {
|
||||
websiteId,
|
||||
sessionId,
|
||||
hostname,
|
||||
ip,
|
||||
userAgent,
|
||||
visitId,
|
||||
salt: visitSalt(),
|
||||
browser,
|
||||
os,
|
||||
country,
|
||||
subdivision1,
|
||||
subdivision2,
|
||||
city,
|
||||
device,
|
||||
});
|
||||
|
||||
// Clickhouse does not require session lookup
|
||||
if (clickhouse.enabled) {
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue