Skip to content

Send logged-out users to login when clicking Follow#2143

Open
c-tonneslan wants to merge 1 commit into
codeforboston:mainfrom
c-tonneslan:fix/follow-button-redirects-to-login
Open

Send logged-out users to login when clicking Follow#2143
c-tonneslan wants to merge 1 commit into
codeforboston:mainfrom
c-tonneslan:fix/follow-button-redirects-to-login

Conversation

@c-tonneslan
Copy link
Copy Markdown

Closes #2059.

Clicking 'Follow H.54' (or any FollowButton variant) while logged out just looked broken: setDoc ran against /users/undefined/activeTopicSubscriptions/... and the security rules quietly rejected it, so the visitor saw nothing.

Pushed the same /login?redirect=... flow that requireAuth already uses, so the visitor signs in and lands back on the testimony (or bill / profile / ballot question) page they came from.

The Follow buttons on the testimony detail page (and elsewhere) silently
no-op'd if a logged-out visitor clicked them: the underlying setDoc
runs against /users/undefined/... and Firestore rules reject it. Push
the visitor through the same /login?redirect= flow other auth-gated
actions use so they end up back on the page they were on.

Closes codeforboston#2059

Signed-off-by: Charlie Tonneslan <cst0520@gmail.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
maple-dev Ready Ready Preview, Comment May 17, 2026 11:23pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Better Error Message for "Follow" Button on Testimony Detail Page

1 participant