mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-07 04:12:04 +00:00
HealthLog — personal health-tracking PWA with weight, blood pressure, pulse, mood tracking, medication compliance, Withings integration, doctor report PDF export, and Dracula-themed UI.
27 lines
684 B
TypeScript
27 lines
684 B
TypeScript
import { prisma } from "@/lib/db";
|
|
import { apiSuccess } from "@/lib/api-response";
|
|
import { apiHandler, requireAuth } from "@/lib/api-handler";
|
|
import { annotate } from "@/lib/logging/context";
|
|
|
|
export const dynamic = "force-dynamic";
|
|
|
|
export const GET = apiHandler(async () => {
|
|
const { user } = await requireAuth();
|
|
|
|
const passkeys = await prisma.passkey.findMany({
|
|
where: { userId: user.id },
|
|
select: {
|
|
id: true,
|
|
name: true,
|
|
credentialDeviceType: true,
|
|
credentialBackedUp: true,
|
|
createdAt: true,
|
|
},
|
|
orderBy: { createdAt: "desc" },
|
|
});
|
|
|
|
annotate({ action: { name: "auth.passkeys.list" } });
|
|
|
|
return apiSuccess(passkeys);
|
|
});
|