Invitation-only sign-up, invitation e-mails and waitlist
- SIGNUP_MODE=invite (default): a new account needs an open invitation for its address, or the invitation link (then any Google account will do) - admin page "Meghívók": invite many addresses at once, personal message, resend (max 3, 24 h apart), revoke, copy link, mail preview and test copy, waitlist - invitation e-mail in HTML and plain text; Message-ID on the sender's domain, List-Unsubscribe with one-click POST, opt-out list (hashes only) - e-mail texts moved to a shared crate (crates/email-templates) - login page shows the invitation; waitlist for uninvited visitors; unsubscribe page; privacy policy updated - docs/levelkuldes.md: Brevo, DNS (SPF, DKIM, DMARC) and the SMTP setup Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -8,7 +8,7 @@ use tokio::sync::watch;
|
||||
const INTERVAL: Duration = Duration::from_secs(3600);
|
||||
|
||||
/// (what, statement) pairs; each returns the number of deleted rows.
|
||||
const STATEMENTS: [(&str, &str); 5] = [
|
||||
const STATEMENTS: [(&str, &str); 6] = [
|
||||
("sessions", "DELETE FROM sessions WHERE expires_at < now()"),
|
||||
("auth_tokens", "DELETE FROM auth_tokens WHERE expires_at < now()"),
|
||||
// Sent e-mails contain links with tokens; keep them a week for support.
|
||||
@@ -18,6 +18,13 @@ const STATEMENTS: [(&str, &str); 5] = [
|
||||
OR failed_at < now() - interval '30 days'",
|
||||
),
|
||||
("invites", "DELETE FROM synastry_invites WHERE accepted_at IS NULL AND expires_at < now() - interval '30 days'"),
|
||||
// Unused invitations 30 days after they closed; accepted ones once the account is deleted.
|
||||
(
|
||||
"invitations",
|
||||
"DELETE FROM invitations WHERE (accepted_at IS NULL \
|
||||
AND least(coalesce(revoked_at, expires_at), expires_at) < now() - interval '30 days') \
|
||||
OR (accepted_at IS NOT NULL AND accepted_by IS NULL)",
|
||||
),
|
||||
("prompt_previews", "DELETE FROM prompt_previews WHERE created_at < now() - interval '30 days'"),
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user