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:
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"users": {},
|
||||
"updatedAt": "2026-06-09T15:26:49.777Z"
|
||||
"updatedAt": "2026-06-17T16:26:39.085Z"
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user