Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Fix session lookup.

Mike Cao9001361e4cae
diff --git a/lib/middleware.ts b/lib/middleware.ts
index 039bdac4a..b0785e2d2 100644
--- a/lib/middleware.ts
+++ b/lib/middleware.ts
@@ -24,7 +24,7 @@ export const useSession = createMiddleware(async (req, res, next) => {
if (!session) {
log('useSession: Session not found');
- return badRequest(res);
+ return badRequest(res, 'Session not found.');
}
(req as any).session = session;
diff --git a/lib/session.ts b/lib/session.ts
index 19c2e405a..af9f4c11e 100644
--- a/lib/session.ts
+++ b/lib/session.ts
@@ -62,7 +62,7 @@ export async function findSession(req: NextApiRequestCollect) {
}
// Find session
- let session = await loadSession(websiteId);
+ let session = await loadSession(sessionId);
// Create a session if not found
if (!session) {