Skip to content

fix: always use dj.wxyc.org for email links#145

Merged
JacksonMeade merged 3 commits intomainfrom
fix-source-disagreements-on-verification
Feb 7, 2026
Merged

fix: always use dj.wxyc.org for email links#145
JacksonMeade merged 3 commits intomainfrom
fix-source-disagreements-on-verification

Conversation

@JacksonMeade
Copy link
Contributor

This is absolutely critical for getting login flow working

Rewrites email verification and password reset URLs to use the frontend domain instead of the backend API domain, while preserving path and query parameters.

What Changed

  • Added rewriteUrlForFrontend helper that replaces only the host and protocol, leaving path and query params intact
  • Applied URL rewriting to verification email links
  • Applied URL rewriting to password reset email links (via buildResetUrl)

Why

Email links now point to dj.wxyc.org instead of api.wxyc.org, so users land on the frontend. The callbackURL query parameter remains a relative path (e.g., /onboarding) that the frontend resolves correctly. This removes the need for frontend URL sanitization helpers.

@JacksonMeade JacksonMeade self-assigned this Feb 6, 2026
@jakebromberg
Copy link
Member

I'm wondering if you would mind implementing tests to cover this?

@JacksonMeade
Copy link
Contributor Author

I'm wondering if you would mind implementing tests to cover this?

I've added a unit test for the behavior of the rewrite function, which is the most 'breakable' part of what I've done here. I will not be writing end to end testing for this until we have new users; this is a zero-level kind of feature that should have been in the original implementation.

@JacksonMeade JacksonMeade merged commit 1d1ae64 into main Feb 7, 2026
4 checks passed
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.

2 participants