Complete refactor of Gemfile and upgraded gems (#2553)

This commit is contained in:
Ahmad Farhat
2021-02-26 17:34:07 -05:00
committed by GitHub
parent c5b00e89aa
commit 09ab074aaf
29 changed files with 327 additions and 376 deletions

View File

@ -20,11 +20,11 @@ module OmniauthOptions
module_function
def omniauth_options(env)
if env['omniauth.strategy'].options[:name] == "bn_launcher"
case env['omniauth.strategy'].options[:name]
when "bn_launcher"
protocol = Rails.env.production? ? "https" : env["rack.url_scheme"]
customer_redirect_url = protocol + "://" + env["SERVER_NAME"] + ":" +
env["SERVER_PORT"]
customer_redirect_url = "#{protocol}://#{env['SERVER_NAME']}:#{env['SERVER_PORT']}"
user_domain = parse_user_domain(env["SERVER_NAME"])
env['omniauth.strategy'].options[:customer] = user_domain
env['omniauth.strategy'].options[:customer_redirect_url] = customer_redirect_url
@ -33,11 +33,11 @@ module OmniauthOptions
# This is only used in the old launcher and should eventually be removed
env['omniauth.strategy'].options[:checksum] = generate_checksum(user_domain, customer_redirect_url,
Rails.configuration.launcher_secret)
elsif env['omniauth.strategy'].options[:name] == "google"
when "google"
set_hd(env, ENV['GOOGLE_OAUTH2_HD'])
elsif env['omniauth.strategy'].options[:name] == "office365"
when "office365"
set_hd(env, ENV['OFFICE365_HD'])
elsif env['omniauth.strategy'].options[:name] == "openid_connect"
when "openid_connect"
set_hd(env, ENV['OPENID_CONNECT_HD'])
end
end