mirror of
https://github.com/bitbaum/evig.git
synced 2026-12-04 17:57:54 +01:00
Presentation comments were dead in prod: the static decks are served outside
middleware, so a reader has no CSRF cookie and the POST always failed
'CSRF validation failed'. Exempt /api/presentations/comments from CSRF (like
the webhook endpoints) and compensate with per-IP rate limiting + the honeypot.
Site feedback widget (/api/suggestions) was email-only and silently lossy —
sendCustomEmail resolves {success:false} instead of throwing, so failed
delivery went unnoticed. Now:
- persists to site_suggestions (migration 127) — the reliable channel
- notifies super admins in-app (bell) per submission
- still emails the team, but CHECKS the result and logs failures
- new admin page /admin/feedback to browse, resolve, copy-as-prompt
- route test updated (13/13) for the new persistence/notify/auth side channels
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
25 lines
1001 B
SQL
25 lines
1001 B
SQL
-- Site feedback / suggestions
|
|
-- The floating "Vorschlag / Feedback" widget on public pages (SuggestionButton)
|
|
-- previously POSTed to /api/suggestions which only sent a fire-and-forget email.
|
|
-- With prod email deliverability unreliable, submissions could be lost silently.
|
|
-- This table makes persistence the reliable channel; email + in-app notification
|
|
-- are best-effort on top.
|
|
|
|
CREATE TABLE IF NOT EXISTS site_suggestions (
|
|
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
suggestion TEXT NOT NULL,
|
|
contact TEXT,
|
|
page TEXT,
|
|
url TEXT,
|
|
page_title TEXT,
|
|
page_section TEXT,
|
|
scope TEXT,
|
|
selected_elements JSONB,
|
|
author_user_id UUID REFERENCES users(id) ON DELETE SET NULL,
|
|
resolved BOOLEAN NOT NULL DEFAULT FALSE,
|
|
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS site_suggestions_unresolved_idx
|
|
ON site_suggestions (resolved, created_at DESC);
|