mirror of
https://github.com/discourse/discourse.git
synced 2025-03-29 08:59:25 +08:00
FIX: Google HD
and Prompt
settings should be checked at runtime
Previously a server restart was required after settings changes, and it did not work in multisite environments
This commit is contained in:
parent
4786b7ff81
commit
a09b20f934
@ -85,19 +85,19 @@ class Auth::GoogleOAuth2Authenticator < Auth::Authenticator
|
|||||||
options = {
|
options = {
|
||||||
setup: lambda { |env|
|
setup: lambda { |env|
|
||||||
strategy = env["omniauth.strategy"]
|
strategy = env["omniauth.strategy"]
|
||||||
strategy.options[:client_id] = SiteSetting.google_oauth2_client_id
|
strategy.options[:client_id] = SiteSetting.google_oauth2_client_id
|
||||||
strategy.options[:client_secret] = SiteSetting.google_oauth2_client_secret
|
strategy.options[:client_secret] = SiteSetting.google_oauth2_client_secret
|
||||||
|
|
||||||
|
if (google_oauth2_hd = SiteSetting.google_oauth2_hd).present?
|
||||||
|
strategy.options[:hd] = google_oauth2_hd
|
||||||
|
end
|
||||||
|
|
||||||
|
if (google_oauth2_prompt = SiteSetting.google_oauth2_prompt).present?
|
||||||
|
strategy.options[:prompt] = google_oauth2_prompt.gsub("|", " ")
|
||||||
|
end
|
||||||
},
|
},
|
||||||
skip_jwt: true
|
skip_jwt: true
|
||||||
}
|
}
|
||||||
|
|
||||||
if (google_oauth2_prompt = SiteSetting.google_oauth2_prompt).present?
|
|
||||||
options[:prompt] = google_oauth2_prompt.gsub("|", " ")
|
|
||||||
end
|
|
||||||
|
|
||||||
google_oauth2_hd = SiteSetting.google_oauth2_hd
|
|
||||||
options[:hd] = google_oauth2_hd if google_oauth2_hd.present?
|
|
||||||
|
|
||||||
# jwt encoding is causing auth to fail in quite a few conditions
|
# jwt encoding is causing auth to fail in quite a few conditions
|
||||||
# skipping
|
# skipping
|
||||||
omniauth.provider :google_oauth2, options
|
omniauth.provider :google_oauth2, options
|
||||||
|
Loading…
x
Reference in New Issue
Block a user