thermograph/static
Emi Griffith 1f99485ca3 Link a Thermograph account to Discord via OAuth2 (#208)
Lets a signed-in user connect their Discord account (OAuth2 identify), storing the
Discord user id that a later feature (DM alerts) will deliver to. Standard
authorization-code flow, all server-side:

- backend/discord_link.py: /discord/link/start redirects to Discord's consent
  screen; /discord/link/callback exchanges the code, reads the Discord user id, and
  stores it; /discord/unlink forgets it. The `state` is signed with the app auth
  secret (stdlib hmac, no new dependency) and carries the Thermograph user id, so a
  callback can't be replayed or bound to another account. Every route requires an
  active session, so linking acts on whoever is actually logged in.
- models.py: User.discord_id (unique, nullable). schemas.py exposes it on UserRead
  so the frontend can show link state.
- app.py: the router under /api/v2/discord.
- account.js: a "Link Discord" / "Unlink Discord" control in the account popover.
- deploy/migrations/001-user-discord-id.sql: the manual column add for the existing
  prod accounts DB. This project has no Alembic — create_all only makes missing
  tables, so an added column needs a hand-applied migration (documented in-file).
- env example: THERMOGRAPH_DISCORD_CLIENT_SECRET + the redirect to register.

Claude-Session: https://claude.ai/code/session_013dRZmX9D3JEntfMKWMTWZ8
2026-07-20 02:26:33 +00:00
..
.well-known Add Android TWA build config and Digital Asset Links (#203) 2026-07-20 00:43:56 +00:00
account.js Link a Thermograph account to Discord via OAuth2 (#208) 2026-07-20 02:26:33 +00:00
app.js Remove em-dashes from site copy and tighten the prose (#206) 2026-07-20 01:48:33 +00:00
apple-touch-icon.png Replace the brand mark with the grid-cell logo everywhere (#199) 2026-07-19 23:45:12 +00:00
cache.js Add a climate-score page from recent-vs-baseline percentile divergence (#196) 2026-07-19 23:02:33 +00:00
calendar.html Remove em-dashes from site copy and tighten the prose (#206) 2026-07-20 01:48:33 +00:00
calendar.js Remove em-dashes from site copy and tighten the prose (#206) 2026-07-20 01:48:33 +00:00
chart.js Remove em-dashes from site copy and tighten the prose (#206) 2026-07-20 01:48:33 +00:00
climate.js Follow the unit system for precipitation and wind too (#190) 2026-07-19 19:03:41 +00:00
compare.html Remove em-dashes from site copy and tighten the prose (#206) 2026-07-20 01:48:33 +00:00
compare.js Remove em-dashes from site copy and tighten the prose (#206) 2026-07-20 01:48:33 +00:00
day.html Remove em-dashes from site copy and tighten the prose (#206) 2026-07-20 01:48:33 +00:00
day.js Render every percentile through one rule (#186) 2026-07-18 09:08:28 +00:00
digest.js Remove em-dashes from site copy and tighten the prose (#206) 2026-07-20 01:48:33 +00:00
favicon-16.png Replace the brand mark with the grid-cell logo everywhere (#199) 2026-07-19 23:45:12 +00:00
favicon-32.png Replace the brand mark with the grid-cell logo everywhere (#199) 2026-07-19 23:45:12 +00:00
favicon-48.png Replace the brand mark with the grid-cell logo everywhere (#199) 2026-07-19 23:45:12 +00:00
favicon.svg Replace the brand mark with the grid-cell logo everywhere (#199) 2026-07-19 23:45:12 +00:00
filtersheet.js Compare basis inline; synced inline + sheet metric selector (both pages) (#82) 2026-07-12 07:45:12 +00:00
google03ab95daa090e8d9.html Add Google Search Console site-verification file (#128) 2026-07-16 18:56:42 +00:00
ios-install.js Remove em-dashes from site copy and tighten the prose (#206) 2026-07-20 01:48:33 +00:00
legend.html Remove em-dashes from site copy and tighten the prose (#206) 2026-07-20 01:48:33 +00:00
logo-192.png Replace the brand mark with the grid-cell logo everywhere (#199) 2026-07-19 23:45:12 +00:00
logo-maskable-192.png Replace the brand mark with the grid-cell logo everywhere (#199) 2026-07-19 23:45:12 +00:00
logo-maskable-512.png Replace the brand mark with the grid-cell logo everywhere (#199) 2026-07-19 23:45:12 +00:00
logo.png Replace the brand mark with the grid-cell logo everywhere (#199) 2026-07-19 23:45:12 +00:00
manifest.webmanifest Replace the brand mark with the grid-cell logo everywhere (#199) 2026-07-19 23:45:12 +00:00
mappicker.js Remove em-dashes from site copy and tighten the prose (#206) 2026-07-20 01:48:33 +00:00
nav.js Add PWA + Web Push delivery for weather alerts (#95) 2026-07-15 23:21:06 +00:00
package.json Convert the frontend to ES modules; split nav.js by concern (#48) 2026-07-11 20:28:33 +00:00
push-client.js Add PWA + Web Push delivery for weather alerts (#95) 2026-07-15 23:21:06 +00:00
score.html Remove em-dashes from site copy and tighten the prose (#206) 2026-07-20 01:48:33 +00:00
score.js Remove em-dashes from site copy and tighten the prose (#206) 2026-07-20 01:48:33 +00:00
shared.js Show a metric's unit once atop its distribution strip (#195) 2026-07-19 22:30:31 +00:00
style.css Make the PWA installable as a standalone iOS home-screen app (#202) 2026-07-20 00:40:04 +00:00
subscriptions.html Remove em-dashes from site copy and tighten the prose (#206) 2026-07-20 01:48:33 +00:00
subscriptions.js Remove em-dashes from site copy and tighten the prose (#206) 2026-07-20 01:48:33 +00:00
sw.js Replace the brand mark with the grid-cell logo everywhere (#199) 2026-07-19 23:45:12 +00:00
units.js Report rain in whole millimetres; lift tier spans out of the bars (#192) 2026-07-19 19:28:58 +00:00