Recognize digest email links and sync pins across devices - #205
Merged
Conversation
Digest links now carry a pins-scoped signed token. Clicking through sets an HttpOnly session cookie so the browser is recognized quietly, with a dismissible "Not you?" banner. Pinned investigations sync to the worker for recognized sessions (union merge on first visit); anonymous localStorage behavior is unchanged. Account changes still require purpose-specific tokens.
jimdc
enabled auto-merge
July 30, 2026 23:06
Update characterization for honest privacy intro, await async redirect handlers, and accept session tokens on digest notice links.
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
Alert digest emails can now quietly recognize the browser that opens them, so pinned investigations follow a subscriber across devices — without a password account or login form.
Bearer-token tradeoff
Anyone who can open a subscriber's email can open a recognized session on their own device by clicking a digest link. That is the same reality as one-click unsubscribe and most "magic link" mail products. Mitigations: the session is scoped to read + pin sync only (unsubscribe, re-subscribe, and other account changes still need a fresh purpose-specific token); email-link tokens expire (~30 days) and renew on the next digest; the session cookie has its own bounded lifetime (~14 days); invalid or expired tokens degrade silently to anonymous; a visible Not you? control signs out instantly; tokens are stripped from the landing URL so they do not linger in history or referrers.
Screenshots
Mobile (390) session banner:
Desktop (1440) session banner:
Privacy section (email links and pins):
Validation
cd worker && node --test test/session_pins.test.mjs test/digest_footer.test.mjsnode --test test/session_pins_client.test.mjs731dad19661d84a2a3532324d58d54434e905ad6Test plan
s=