Share rewards: a question for a visit, an analysis for a new user
CI / test (push) Successful in 1m33s
CI / build (push) Successful in 6m18s
CI / deploy (push) Skipped

A click proves little, so the first visit of a shared link now earns a
question (once per user) instead of a natal analysis. A natal analysis is
earned by bringing a new user: the share page remembers the link, the
Google sign-up sends it, and when that user makes their own chart the
sharer gets one, at most three (referrals table, referral_reward). This is
off until sign-up opens (REFERRAL_REWARDS, default false). The share button
and its small print follow; /v1/me tells what was earned.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
feco
2026-11-19 11:24:49 +00:00
co-authored by Claude Opus 5.5
parent 8e1205359d
commit 0e3eaee735
16 changed files with 265 additions and 29 deletions
+6
View File
@@ -49,6 +49,10 @@ pub struct Config {
/// compatible are we?" links, which also let the invitee sign up). Off
/// until the launch; admins may always.
pub user_invites: bool,
/// `REFERRAL_REWARDS` (default `false`): someone who signs up from a
/// shared link and makes their own chart earns the sharer a natal
/// analysis (at most three). Off until sign-up opens.
pub referral_rewards: bool,
/// `GOOGLE_CLIENT_IDS`: comma-separated OAuth client ids accepted as the
/// ID token audience; empty disables Google login.
pub google_client_ids: Vec<String>,
@@ -124,6 +128,7 @@ impl Config {
password_login: parsed("PASSWORD_LOGIN", false)?,
mock_payments: parsed("MOCK_PAYMENTS", false)?,
user_invites: parsed("USER_INVITES", false)?,
referral_rewards: parsed("REFERRAL_REWARDS", false)?,
google_client_ids: list("GOOGLE_CLIENT_IDS"),
google_jwks_url: var("GOOGLE_JWKS_URL")
.unwrap_or_else(|| "https://www.googleapis.com/oauth2/v3/certs".into()),
@@ -162,6 +167,7 @@ impl Config {
password_login: true,
mock_payments: true,
user_invites: true,
referral_rewards: true,
google_client_ids: vec!["test-client.apps.googleusercontent.com".into()],
google_jwks_url,
bootstrap_admin_emails: vec!["admin@example.com".into()],