lib/doorkeeper/engine.rb in doorkeeper-5.6.2 vs lib/doorkeeper/engine.rb in doorkeeper-5.6.3
- old
+ new
@@ -1,12 +1,14 @@
# frozen_string_literal: true
module Doorkeeper
class Engine < Rails::Engine
- initializer "doorkeeper.params.filter" do |app|
- parameters = %w[client_secret authentication_token access_token refresh_token]
- parameters << "code" if Doorkeeper.config.grant_flows.include?("authorization_code")
- app.config.filter_parameters << /^(#{Regexp.union(parameters)})$/
+ initializer "doorkeeper.params.filter", after: :load_config_initializers do |app|
+ if Doorkeeper.configured?
+ parameters = %w[client_secret authentication_token access_token refresh_token]
+ parameters << "code" if Doorkeeper.config.grant_flows.include?("authorization_code")
+ app.config.filter_parameters << /^(#{Regexp.union(parameters)})$/
+ end
end
initializer "doorkeeper.routes" do
Doorkeeper::Rails::Routes.install!
end