Skip to content
Snippets Groups Projects
Commit 85da83f8 authored by shawn-higgins1's avatar shawn-higgins1 Committed by Jesus Federico
Browse files

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

parent eb824257
Branches
No related tags found
No related merge requests found
...@@ -33,7 +33,7 @@ module ApplicationHelper ...@@ -33,7 +33,7 @@ module ApplicationHelper
# Determines which providers can show a login button in the login modal. # Determines which providers can show a login button in the login modal.
def iconset_providers 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] providers.delete(:twitter) if session[:old_twitter_user_id]
......
...@@ -99,6 +99,7 @@ module SessionsHelper ...@@ -99,6 +99,7 @@ module SessionsHelper
end end
def set_hd(env, hd) def set_hd(env, hd)
if hd
hd_opts = hd.split(',') hd_opts = hd.split(',')
env['omniauth.strategy'].options[:hd] = env['omniauth.strategy'].options[:hd] =
if hd_opts.empty? if hd_opts.empty?
...@@ -109,6 +110,7 @@ module SessionsHelper ...@@ -109,6 +110,7 @@ module SessionsHelper
hd_opts hd_opts
end end
end end
end
def migrate_twitter_user(user) def migrate_twitter_user(user)
if !session["old_twitter_user_id"].nil? && user.provider != "twitter" if !session["old_twitter_user_id"].nil? && user.provider != "twitter"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment