Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

fix: setting demo sessions to 15m

Andrejd45129c13c6a
diff --git a/apps/api/src/index.ts b/apps/api/src/index.ts
index 3eef08fb2..b9fdd8df1 100644
--- a/apps/api/src/index.ts
+++ b/apps/api/src/index.ts
@@ -35,14 +35,15 @@ const app = new Elysia()
.guard({
async beforeHandle({ store, cookie: { session }, set }) {
const isDemoMode = process.env.DEMO_MODE === "true";
+ const demoExpiresAt = new Date(Date.now() + 15 * 60 * 1000);
- if (isDemoMode) {
+ if (isDemoMode && !session?.value) {
const {
id,
name,
email,
session: demoSession,
- expiresAt,
+ expiresAt = demoExpiresAt,
} = await createDemoUser();
set.cookie = {