Complete refactor of Gemfile and upgraded gems (#2553)

This commit is contained in:
Ahmad Farhat
2021-02-26 17:34:07 -05:00
committed by GitHub
parent c5b00e89aa
commit 09ab074aaf
29 changed files with 327 additions and 376 deletions

View File

@ -33,7 +33,7 @@ module BbbApi
# Build the URI.
uri = encode_bbb_url(
Rails.configuration.loadbalancer_endpoint + api + '/',
"#{Rails.configuration.loadbalancer_endpoint}#{api}/",
Rails.configuration.loadbalancer_secret,
{ name: provider },
route

View File

@ -20,11 +20,11 @@ module OmniauthOptions
module_function
def omniauth_options(env)
if env['omniauth.strategy'].options[:name] == "bn_launcher"
case env['omniauth.strategy'].options[:name]
when "bn_launcher"
protocol = Rails.env.production? ? "https" : env["rack.url_scheme"]
customer_redirect_url = protocol + "://" + env["SERVER_NAME"] + ":" +
env["SERVER_PORT"]
customer_redirect_url = "#{protocol}://#{env['SERVER_NAME']}:#{env['SERVER_PORT']}"
user_domain = parse_user_domain(env["SERVER_NAME"])
env['omniauth.strategy'].options[:customer] = user_domain
env['omniauth.strategy'].options[:customer_redirect_url] = customer_redirect_url
@ -33,11 +33,11 @@ module OmniauthOptions
# This is only used in the old launcher and should eventually be removed
env['omniauth.strategy'].options[:checksum] = generate_checksum(user_domain, customer_redirect_url,
Rails.configuration.launcher_secret)
elsif env['omniauth.strategy'].options[:name] == "google"
when "google"
set_hd(env, ENV['GOOGLE_OAUTH2_HD'])
elsif env['omniauth.strategy'].options[:name] == "office365"
when "office365"
set_hd(env, ENV['OFFICE365_HD'])
elsif env['omniauth.strategy'].options[:name] == "openid_connect"
when "openid_connect"
set_hd(env, ENV['OPENID_CONNECT_HD'])
end
end

View File

@ -20,7 +20,7 @@ namespace :office365 do
old_user.save!
else
old_main_room = old_user.main_room
old_main_room.name = "Old " + old_main_room.name
old_main_room.name = "Old #{old_main_room.name}"
old_main_room.save!
new_user.rooms << old_user.rooms

View File

@ -39,7 +39,7 @@ namespace :room do
next if room.uid.split("-").length > 3
begin
new_uid = room.uid + "-" + SecureRandom.alphanumeric(3).downcase
new_uid = "#{room.uid}-#{SecureRandom.alphanumeric(3).downcase}"
puts "Updating #{room.uid} to #{new_uid}"
room.update_attributes(uid: new_uid)
rescue => e

View File

@ -35,7 +35,10 @@ namespace :user do
u[:email].prepend "superadmin-" if args[:role] == "super_admin"
# Create account if it doesn't exist
if !User.exists?(email: u[:email], provider: u[:provider])
if User.exists?(email: u[:email], provider: u[:provider])
puts "Account with that email already exists"
puts "Email: #{u[:email]}"
else
user = User.create(name: u[:name], email: u[:email], password: u[:password],
provider: u[:provider], email_verified: true, accepted_terms: true)
@ -52,9 +55,6 @@ namespace :user do
puts "Password: #{u[:password]}"
puts "Role: #{u[:role]}"
puts "PLEASE CHANGE YOUR PASSWORD IMMEDIATELY" if u[:password] == Rails.configuration.admin_password_default
else
puts "Account with that email already exists"
puts "Email: #{u[:email]}"
end
end
end