Skip to content

DEV: Use canonical hostname for omniauth callbacks #33102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2025

Conversation

davidtaylorhq
Copy link
Member

In production, the enforce_hostname middleware overwrites the HTTP_HOST env using Discourse.base_url_no_prefix, which takes into account any configured protocol/hostname/post overrides.

That middleware is not used in development, so if we want omniauth to respect any host/port overrides, we need to configure the 'full host' directly.

In production, the enforce_hostname middleware overwrites the HTTP_HOST env using `Discourse.base_url_no_prefix`, which takes into account any configured protocol/hostname/post overrides.

That middleware is not used in development, so if we want omniauth to respect any host/port overrides, we need to configure the 'full host' directly.
@davidtaylorhq davidtaylorhq marked this pull request as ready for review June 6, 2025 13:43
@davidtaylorhq davidtaylorhq merged commit 6b5dea2 into main Jun 6, 2025
17 checks passed
@davidtaylorhq davidtaylorhq deleted the omniauth-redirect-host branch June 6, 2025 14:35
martin-brennan pushed a commit that referenced this pull request Jun 10, 2025
In production, the enforce_hostname middleware overwrites the HTTP_HOST
env using `Discourse.base_url_no_prefix`, which takes into account any
configured protocol/hostname/post overrides.

That middleware is not used in development, so if we want omniauth to
respect any host/port overrides, we need to configure the 'full host'
directly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants