We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent abb39fa commit d8e19c7Copy full SHA for d8e19c7
1 file changed
config/initializers/omniauth.rb
@@ -1,8 +1,9 @@
1
# frozen_string_literal: true
2
3
Rails.application.config.middleware.use OmniAuth::Builder do
4
- base_url = if (host = ENV["APPLICATION_HOST"])
5
- "https://#{host}"
+ redirect_uri = if Rails.env.production?
+ host = ENV.fetch("APPLICATION_HOST", "calendar.witcc.dev")
6
+ "https://#{host}/auth/google_oauth2/callback"
7
end
8
9
provider(
@@ -20,7 +21,7 @@
20
21
access_type: "offline",
22
prompt: "consent",
23
include_granted_scopes: true,
- redirect_uri: base_url ? "#{base_url}/auth/google_oauth2/callback" : nil
24
+ redirect_uri: redirect_uri
25
}.compact
26
)
27
0 commit comments