Please...
All checks were successful
Docker Deploy / build-and-push (push) Successful in 3m55s

This commit is contained in:
2026-02-13 11:18:20 -07:00
parent 44de064d68
commit 705358d44c
14 changed files with 200 additions and 121 deletions

View File

@@ -3,7 +3,7 @@ import { verifyAuthenticationResponse } from "@simplewebauthn/server";
import { db } from "../../../../../db";
import { users, passkeys, passkeyChallenges } from "../../../../../db/schema";
import { eq, and, gt } from "drizzle-orm";
import { createSession } from "../../../../../lib/auth";
import { setAuthCookie } from "../../../../../lib/auth";
export const POST: APIRoute = async ({ request, cookies }) => {
const body = await request.json();
@@ -82,15 +82,7 @@ export const POST: APIRoute = async ({ request, cookies }) => {
})
.where(eq(passkeys.id, passkey.id));
const { sessionId, expiresAt } = await createSession(user.id);
cookies.set("session_id", sessionId, {
path: "/",
httpOnly: true,
secure: import.meta.env.PROD,
sameSite: "lax",
expires: expiresAt,
});
setAuthCookie(cookies, user.id);
await db
.delete(passkeyChallenges)