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
+1 -1
View File
@@ -1,4 +1,4 @@
{ {
"users": {}, "users": {},
"updatedAt": "2026-06-09T15:26:49.777Z" "updatedAt": "2026-06-17T16:26:39.085Z"
} }
+4 -1
View File
@@ -1,5 +1,5 @@
import { createHash, randomUUID } from 'node:crypto' 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 { getClientIp, hasVisitorConsent, setConsentCookie, parseCookies } from '../helpers.js'
import { import {
VISITOR_COOKIE, VISITOR_COOKIE,
@@ -147,6 +147,9 @@ export function register(app) {
}) })
app.post('/api/analytics/pageview', async (req, res) => { app.post('/api/analytics/pageview', async (req, res) => {
if (isValidAdminSession(req)) {
res.json({ ok: false, reason: 'admin' }); return
}
if (!hasVisitorConsent(req)) { if (!hasVisitorConsent(req)) {
res.json({ ok: false, reason: 'no-consent' }); return res.json({ ok: false, reason: 'no-consent' }); return
} }