Claim goal notifications before sending them
The check read "already sent?" and recorded the send afterwards, so two overlapping checks could both notify. Claim the (goal, day) row first with ON CONFLICT DO NOTHING and release it if ntfy fails, so a later check retries. The handler now returns a typed result instead of a map[string]any, and shares one ntfy client. Fix two comments that still said nginx. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// Package auth decides whether a request comes from the site's admin.
|
||||
//
|
||||
// Like the job tracker, the activity tracker has no users or passwords of its
|
||||
// own. It runs behind the main site's nginx at /tracker/ and borrows that
|
||||
// own. It runs behind the main site's Caddy at /tracker/ and borrows that
|
||||
// site's session: the browser already carries the site's HTTP-only auth
|
||||
// cookies (Path=/) on every request, so the tracker forwards the Cookie header
|
||||
// to the site backend's GET /auth/validate-admin and treats a 2xx as "admin".
|
||||
|
||||
Reference in New Issue
Block a user