Skip to content

Commit 6b5dea2

Browse files
DEV: Use canonical hostname for omniauth callbacks (#33102)
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.
1 parent cb6cc8d commit 6b5dea2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

config/initializers/009-omniauth.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,5 @@
5252

5353
OmniAuth::FailureEndpoint.call(env)
5454
end
55+
56+
OmniAuth.config.full_host = Proc.new { Discourse.base_url_no_prefix }

0 commit comments

Comments
 (0)