forked from External/greenlight
GRN-80: Allow local accounts on multitenant (#428)
* Changed the way the omniauth providers are declared * Allow local authentication for multitenant mode based on customer settings * Cleanead up code mandated by rubocop * Completed implementation for signin and added the one for signup * Fixed issue with rubocop * Renamed customer_name to lb_user * Renamed lb_user -> user_domain, fixed issue with signup controller, email verification WAS NOT implemented * Completed implementation of email_verification * Fixed rubocop issue * Final update * Fix for test with loadbalancer * Make sure loadbalancer mockup is only used when env defined * Fix for test on rooms_controller * Fixed most of the test failing on multitenant env * Fixed issue detected by rubocop * Fixed issue with activation tockens not working on resend * Fixed new issue found by rubocop * Updated travis script * Harcoded credentials for mockup * Updated expectation on start_session * Fixed issue with duplication of home room * Updated script for rubocop * Restored Gemfile
This commit is contained in:
@ -23,6 +23,7 @@ class ApplicationController < ActionController::Base
|
||||
|
||||
before_action :migration_error?
|
||||
before_action :set_locale
|
||||
before_action :set_user_domain
|
||||
|
||||
# Force SSL for loadbalancer configurations.
|
||||
before_action :redirect_to_https
|
||||
@ -68,16 +69,11 @@ class ApplicationController < ActionController::Base
|
||||
|
||||
# Determines if the BigBlueButton endpoint is configured (or set to default).
|
||||
def bigbluebutton_endpoint_default?
|
||||
return false if loadbalanced_configuration?
|
||||
return false if Rails.configuration.loadbalanced_configuration
|
||||
Rails.configuration.bigbluebutton_endpoint_default == Rails.configuration.bigbluebutton_endpoint
|
||||
end
|
||||
helper_method :bigbluebutton_endpoint_default?
|
||||
|
||||
def loadbalanced_configuration?
|
||||
Rails.configuration.loadbalanced_configuration
|
||||
end
|
||||
helper_method :loadbalanced_configuration?
|
||||
|
||||
def recording_thumbnails?
|
||||
Rails.configuration.recording_thumbnails
|
||||
end
|
||||
@ -106,6 +102,17 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
|
||||
def redirect_to_https
|
||||
redirect_to protocol: "https://" if loadbalanced_configuration? && request.headers["X-Forwarded-Proto"] == "http"
|
||||
if Rails.configuration.loadbalanced_configuration && request.headers["X-Forwarded-Proto"] == "http"
|
||||
redirect_to protocol: "https://"
|
||||
end
|
||||
end
|
||||
|
||||
def set_user_domain
|
||||
@user_domain = if Rails.env.test? || !Rails.configuration.loadbalanced_configuration
|
||||
"greenlight"
|
||||
else
|
||||
parse_user_domain(request.env["SERVER_NAME"])
|
||||
end
|
||||
end
|
||||
helper_method :set_user_domain
|
||||
end
|
||||
|
Reference in New Issue
Block a user