8bde4187 🐛 Fixed unsubscribe links affecting the wrong member when logged in
no ref
An email unsubscribe link carries a uuid and key identifying whose
subscription it manages, but Portal's unsubscribe page routed the
actual update through the browser's member session whenever one
existed. If the link belonged to a different member — a forwarded
email, a shared device, or staff opening a reader's link — the
logged-in member was silently unsubscribed instead of the link's
owner, and their newsletter selection was overwritten with the other
member's list. The flow auto-executes on page load, so a single open
of someone else's link was enough.
A mismatched session almost always signals a mistake, so the page
now rejects it outright: an error explains the link belongs to a
different email address, nobody's preferences are touched, and the
link member's data is never fetched, so nothing about the other
subscriber is exposed to the session. The auto-run effect also stops
a stale in-flight request from writing after the logged-in member
changes, so the rejection can't be bypassed by a race. The
logged-out flow and the member's own link are unchanged.