forked from External/greenlight
GRN-93: Fix for issue with excesive requests to LB (#447)
* Fix for issue with excesive requests to lb * Fixed issue with rspec on users not passing when run alone * Include dotenv in production
This commit is contained in:
@ -111,7 +111,7 @@ class ApplicationController < ActionController::Base
|
||||
@user_domain = if Rails.env.test? || !Rails.configuration.loadbalanced_configuration
|
||||
"greenlight"
|
||||
else
|
||||
parse_user_domain(request.env["SERVER_NAME"])
|
||||
parse_user_domain(request.host)
|
||||
end
|
||||
end
|
||||
helper_method :set_user_domain
|
||||
|
@ -84,7 +84,8 @@ module ApplicationHelper
|
||||
begin
|
||||
provider_info = retrieve_provider_info(@user_domain, 'api2', 'getUserGreenlightCredentials')
|
||||
provider_info['provider'] == 'greenlight'
|
||||
rescue
|
||||
rescue => ex
|
||||
logger.info ex
|
||||
false
|
||||
end
|
||||
end
|
||||
|
@ -54,7 +54,9 @@ module SessionsHelper
|
||||
end
|
||||
|
||||
def parse_user_domain(hostname)
|
||||
hostname.split('.').first
|
||||
return hostname.split('.').first unless Rails.configuration.url_host
|
||||
return '' unless hostname.include?(Rails.configuration.url_host)
|
||||
hostname.chomp(Rails.configuration.url_host).chomp('.')
|
||||
end
|
||||
|
||||
def omniauth_options(env)
|
||||
|
@ -17,7 +17,7 @@
|
||||
# with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
class UserMailer < ApplicationMailer
|
||||
default from: Rails.configuration.email_sender
|
||||
default from: Rails.configuration.smtp_sender
|
||||
|
||||
def verify_email(user, url)
|
||||
@user = user
|
||||
|
@ -185,6 +185,7 @@ class User < ApplicationRecord
|
||||
end
|
||||
|
||||
def greenlight_account?
|
||||
return true unless provider # For testing cases when provider is set to null
|
||||
return provider == "greenlight" unless Rails.configuration.loadbalanced_configuration
|
||||
# No need to retrive the provider info if the provider is whitelisted
|
||||
return true if launcher_allow_user_signup_whitelisted?(provider)
|
||||
|
Reference in New Issue
Block a user