wave: report T&C and privacy policy versions on login#1899
Merged
Conversation
Wave backend (drips-network/wave#537) now requires `termsVersion` and `privacyVersion` query params on the GitHub OAuth login URL so it can persist a consent record per user/version pair. Add a small constants module as the source of truth for the document versions, and append both params alongside the existing `backTo`/`skipWelcome`/`ref` params in the login button. Bump the constants whenever the Terms & Rules or Privacy Policy is materially updated; the backend will write a fresh consent row on the next login while preserving the timestamp of any earlier consent.
Drive the "effective as of …" line on /legal/privacy from PRIVACY_POLICY_VERSION rather than a hand-typed string. The constant is also what the login button reports to the wave backend on consent, so display and transport are now guaranteed to come from the same source — bumping the policy text and the login-time recorded version become a single diff. Bump PRIVACY_POLICY_VERSION to 2026-04-29 to match the date already stated on the page.
efstajas
approved these changes
May 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/lib/utils/wave/legal-versions.ts: a single source of truth for the version strings of the Wave Terms & Rules and Privacy Policy. The login button appends both as query params on the wave OAuth login URL so the backend can persist a click-wrap consent record (drips-network/wave#537).log-in-button.svelteinto a smallbuildLoginHrefhelper that always emitstermsVersion+privacyVersion, plus the existingbackTo/skipWelcome/refwhen applicable./legal/privacyfrom the samePRIVACY_POLICY_VERSIONconstant. Updating the policy text and bumping the recorded version are now one diff — display and transport can't drift.Why FE-reported (not server-side) versions
The wave backend stores whatever this PR sends. We record the rendered version because that is the value the user actually saw on screen, which is what click-wrap defensibility hinges on. A server-side resolution path would let the BE config drift ahead of the FE during partial deploys and record values the user never saw — the opposite of what the audit record is for.
The state isn't HMAC-signed. A determined client could submit a wrong version, but tampering only deflates the user's own recorded version, which is self-defeating: re-prompt enforcement is forward-looking off the live constant on the next sensitive action. This matches industry click-wrap norms (GitHub, Stripe, Apple).
Coordination with backend
Pairs with drips-network/wave#537. The wave backend now requires
termsVersionandprivacyVersionquery params onGET /api/auth/oauth/github/loginand rejects missing values with a 400 before the GitHub redirect. Deploy this PR before the wave PR — otherwise every login attempt 400s until the FE catches up.Test plan
npm run lintclean on the changed filesnpm run checkshows no new errors/warnings on changed files/wave/login, click "Log in with GitHub", inspect the URL — confirmtermsVersion=2026-04-27&privacyVersion=2026-04-29is present/legal/privacy, scroll to bottom — confirm the effective date reads "April 29, 2026" (rendered from the constant)tc_consentsrow is written with both versionsPRIVACY_POLICY_VERSIONlocally, log in again — confirm a newtc_consentsrow appears with the bumped version while the old one'sconsented_atis preserved