Describe the bug
It seems that the introduction of custom OAuth providers in #5516 breaks previous customized initializers.
If you have an initializer configuring some custom OAuth and upgrade it to the latest Decidim (aka that includes the commit 012b5b1) you'll find that you won't be able to start rails, with this kind of message:
bin/rails db:migrate:status
rails aborted!
NoMethodError: undefined method `new' for Decidim:Module
/home/ivan/projects/Decidim/decidim/development_app/config/environment.rb:5:in `<main>'
bin/rails:4:in `<top (required)>'
bin/rails:6:in `load'
bin/rails:6:in `<main>'
Tasks: TOP => db:migrate:status => db:load_config => environment
(See full trace by running task with --trace)
In other cases, the message may complaint about duplicated route definitition.
To Reproduce
Steps to reproduce the behavior:
- use a recent version of Decidim
- create a file in
config/initializers/, ie: omniauth_decidim.rb with this content:
# frozen_string_literal: true
if Rails.application.secrets.dig(:omniauth, :decidim, :enabled)
Devise.setup do |config|
config.omniauth :decidim,
Rails.application.secrets.dig(:omniauth, :decidim, :client_id),
Rails.application.secrets.dig(:omniauth, :decidim, :client_secret),
Rails.application.secrets.dig(:omniauth, :decidim, :site_url),
scope: :public
end
Decidim::User.omniauth_providers << :decidim
end
- Configure
config/secrets.yml with the "decidim" variable enable, for instance in the "development" section:
development:
<<: *default
secret_key_base: ...
omniauth:
developer:
enabled: true
decidim:
enabled: true
- Try to initiate rails, or the console. You can't.
Expected behavior
That system oauth configuration shouldn't broke already working ones if configured already. Only if override some parameters.
Screenshots
N/A
Stacktrace
See description
Extra data (please complete the following information):
- Device: N/A
- Device OS: N/A
- Browser: N/A
- Decidim Version: 0.21-pre
- Decidim installation: metadecidim for instance, any using latest decidim with custom omniauth
Additional context
See #5760 which dives a little in a specific case
Describe the bug
It seems that the introduction of custom OAuth providers in #5516 breaks previous customized initializers.
If you have an initializer configuring some custom OAuth and upgrade it to the latest Decidim (aka that includes the commit 012b5b1) you'll find that you won't be able to start rails, with this kind of message:
In other cases, the message may complaint about duplicated route definitition.
To Reproduce
Steps to reproduce the behavior:
config/initializers/, ie:omniauth_decidim.rbwith this content:config/secrets.ymlwith the "decidim" variable enable, for instance in the "development" section:Expected behavior
That system oauth configuration shouldn't broke already working ones if configured already. Only if override some parameters.
Screenshots
N/A
Stacktrace
See description
Extra data (please complete the following information):
Additional context
See #5760 which dives a little in a specific case