mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Return session data.
This commit is contained in:
parent
c0a67dadd5
commit
c39f5f4195
3 changed files with 5 additions and 19 deletions
|
|
@ -42,24 +42,6 @@ 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 {
|
||||
|
|
@ -76,6 +58,8 @@ export async function getSession(req: NextApiRequestCollect): Promise<SessionDat
|
|||
subdivision1,
|
||||
subdivision2,
|
||||
city,
|
||||
ip,
|
||||
userAgent,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -222,4 +222,6 @@ export interface SessionData {
|
|||
subdivision1: string;
|
||||
subdivision2: string;
|
||||
city: string;
|
||||
ip?: string;
|
||||
userAgent?: string;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ export default async (req: NextApiRequestCollect, res: NextApiResponse) => {
|
|||
|
||||
const cache = createToken(session, secret());
|
||||
|
||||
return ok(res, { cache });
|
||||
return ok(res, { ...session, cache });
|
||||
}
|
||||
|
||||
return methodNotAllowed(res);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue