feat: track unique logins

This commit is contained in:
Linus Rath
2026-04-28 08:19:46 +02:00
parent 2c419cc4fe
commit dafc8ace3c
9 changed files with 186 additions and 29 deletions
+6 -1
View File
@@ -10,6 +10,7 @@ import {
sendOnce,
reschedule,
DEFAULT_ENDPOINT,
getLoginCounts,
} from '@/lib/telemetry';
/**
@@ -23,7 +24,10 @@ export async function GET() {
if ('error' in auth) return auth.error;
const { consent, source, state } = await effectiveConsent();
const payload = await buildPayload();
const [payload, accountCounts] = await Promise.all([
buildPayload(),
getLoginCounts(),
]);
return NextResponse.json(
{
@@ -35,6 +39,7 @@ export async function GET() {
nextScheduledAt: state.nextScheduledAt,
defaultEndpoint: DEFAULT_ENDPOINT,
payloadPreview: payload,
accountCounts,
},
{ headers: { 'Cache-Control': 'no-store' } },
);