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
+3
View File
@@ -10,6 +10,7 @@ import {
setStalwartAuthContextInStore,
} from '@/lib/stalwart/auth-context';
import { configManager } from '@/lib/admin/config-manager';
import { recordLogin } from '@/lib/telemetry/login-tracker';
const COOKIE_OPTIONS = {
...getCookieOptions(),
@@ -50,6 +51,8 @@ export async function POST(request: NextRequest) {
authHeader,
});
void recordLogin(username, normalizedServerUrl);
return NextResponse.json({ ok: true });
} catch (error) {
if (error instanceof JmapAuthVerificationError) {