Skip to content
Snippets Groups Projects
Commit 984e5cc0 authored by Ahmad Farhat's avatar Ahmad Farhat Committed by Jesus Federico
Browse files

Fixed 500 caused by 1 provider (#937)

parent 079d6479
Branches
Tags release-2.4.2 release-2.4.2-rc.1
No related merge requests found
......@@ -30,11 +30,13 @@ class SessionsController < ApplicationController
def signin
check_if_twitter_account
@providers = configured_providers
if one_provider
provider_path = if Rails.configuration.omniauth_ldap
ldap_signin_path
else
"#{Rails.configuration.relative_url_root}/auth/#{providers.first}"
"#{Rails.configuration.relative_url_root}/auth/#{@providers.first}"
end
return redirect_to provider_path
......@@ -156,9 +158,7 @@ class SessionsController < ApplicationController
end
def one_provider
providers = configured_providers
(!allow_user_signup? || !allow_greenlight_accounts?) && providers.count == 1 &&
(!allow_user_signup? || !allow_greenlight_accounts?) && @providers.count == 1 &&
!Rails.configuration.loadbalanced_configuration
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment