Skip to content

Commit

Permalink
fix(sessions/v1.0): keepalive duration ebing wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
IncognitoTGT committed Jul 21, 2024
1 parent d797204 commit 6fdb1c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/api/session/[slug]/keepalive/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { auth } from "@/lib/auth";
import { getConfig } from "@/lib/config";
import { db, session } from "@/lib/drizzle/db";
import { getSession } from "@/lib/session/get-session";
import { eq } from "drizzle-orm";
Expand All @@ -7,7 +8,7 @@ export async function POST(_req: NextRequest, { params }: { params: { slug: stri
const userSession = await auth();
const { id } = (await getSession(params.slug, userSession)) || {};
const date = new Date();
date.setDate(date.getDate() + 7);
date.setHours(date.getHours() + (getConfig().session?.keepaliveDuration || 1440));
if (!id) {
return Response.json({ error: "Not Found" }, { status: 404 });
}
Expand Down

0 comments on commit 6fdb1c3

Please sign in to comment.