Fix office365 if hd environment variable isn't set (#629)

This commit is contained in:
shawn-higgins1 2019-07-11 11:14:43 -04:00 committed by Jesus Federico
parent eb82425747
commit 85da83f8b0
2 changed files with 11 additions and 9 deletions

View File

@ -33,7 +33,7 @@ module ApplicationHelper
# Determines which providers can show a login button in the login modal.
def iconset_providers
providers = configured_providers & [:google, :twitter, :microsoft_office365, :ldap]
providers = configured_providers & [:google, :twitter, :office365, :ldap]
providers.delete(:twitter) if session[:old_twitter_user_id]

View File

@ -99,6 +99,7 @@ module SessionsHelper
end
def set_hd(env, hd)
if hd
hd_opts = hd.split(',')
env['omniauth.strategy'].options[:hd] =
if hd_opts.empty?
@ -109,6 +110,7 @@ module SessionsHelper
hd_opts
end
end
end
def migrate_twitter_user(user)
if !session["old_twitter_user_id"].nil? && user.provider != "twitter"