Update study reminders timestamp and exclude admin sessions from pageview analytics

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
nmemmert
2026-06-17 13:24:48 -04:00
parent a1d5889711
commit 1010cb1f33
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -1,5 +1,5 @@
import { createHash, randomUUID } from 'node:crypto'
import { requireAdminAuth } from '../auth.js'
import { requireAdminAuth, isValidAdminSession } from '../auth.js'
import { getClientIp, hasVisitorConsent, setConsentCookie, parseCookies } from '../helpers.js'
import {
VISITOR_COOKIE,
@@ -147,6 +147,9 @@ export function register(app) {
})
app.post('/api/analytics/pageview', async (req, res) => {
if (isValidAdminSession(req)) {
res.json({ ok: false, reason: 'admin' }); return
}
if (!hasVisitorConsent(req)) {
res.json({ ok: false, reason: 'no-consent' }); return
}