Fixed #318 Allow multiple domains when using Google as OAuth provider (GRN-38) (#319)

* <Added muli_domain restriction with google_oauth>

* <Fixed code style>

* <Added some rspec tests>
This commit is contained in:
John Ma
2018-11-15 15:01:53 -05:00
committed by Jesus Federico
parent 1954ba4cff
commit efa9e08dfc
4 changed files with 46 additions and 5 deletions

View File

@ -67,4 +67,16 @@ module SessionsHelper
env['omniauth.strategy'].options[:checksum] = generate_checksum parse_customer_name(env["SERVER_NAME"]),
gl_redirect_url, Rails.configuration.launcher_secret
end
def google_omniauth_hd(env, hd)
hd_opts = hd.split(',')
env['omniauth.strategy'].options[:hd] =
if hd_opts.empty?
nil
elsif hd_opts.length == 1
hd_opts[0]
else
hd_opts
end
end
end