forked from External/greenlight
		
	Fixed 500 caused by 1 provider (#937)
This commit is contained in:
		
				
					committed by
					
						
						Jesus Federico
					
				
			
			
				
	
			
			
			
						parent
						
							079d64795b
						
					
				
				
					commit
					984e5cc085
				
			@@ -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
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user