[deploy] Fix URL.domain in development by correctly loading authentication providers (#10296)

This commit is contained in:
rhymes 2020-09-13 23:49:18 +02:00 committed by GitHub
parent 0fba78a611
commit b90bbdd87a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 10 deletions

View file

@ -1,3 +1,12 @@
# We require all authentication modules to make sure providers
# are correctly preloaded and ready to be used at this point as the loading
# order is important
require_dependency Rails.root.join("app/services/authentication/providers/provider.rb")
Dir[Rails.root.join("app/services/authentication/**/*.rb")].each do |f|
require_dependency(f)
end
module Authentication
module Providers
# Retrieves a provider that is both available and enabled

View file

@ -45,8 +45,8 @@ module PracticalDeveloper
config.eager_load_paths += Dir["#{config.root}/lib"]
# Middlewares folder is not otherwise autorequired.
Dir["./app/middlewares/*.rb"].sort.each do |file|
require file
Dir["#{config.root}/app/middlewares/**/*.rb"].each do |file|
require_dependency(file)
end
config.active_job.queue_adapter = :sidekiq

View file

@ -1,8 +0,0 @@
Rails.application.config.to_prepare do
# We require all authentication modules to make sure providers
# are correctly preloaded and ready to be used at this point as the loading
# order is important
Dir[Rails.root.join("app/services/authentication/**/*.rb")].each do |f|
require_dependency(f)
end
end