Skip to content

Commit

Permalink
Make omniauth idcat mobil compatible since Decidim 0.20 (#5)
Browse files Browse the repository at this point in the history
* Remove line where the omniauth provider is added manually

* Remove initializer to force `Decidim::CurrentOrganization` to be executed before `Warden::Manager`

* Update gemspec to be specific on Decidim's compatibility DECIDIM_VERSION= ">= 0.20.0"

Co-authored-by: Jesús Di Bari <[email protected]>
  • Loading branch information
tramuntanal and Jesús Di Bari authored Apr 28, 2020
1 parent e84b34a commit 740449b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ This project is in BETA, but going to be tested in production.

## next version:

## Version 0.0.5 (MINOR)
- Make gem compatible with Decidim v0.20 (tested against decidim v0.21)
- Remove initializer to force `Decidim::CurrentOrganization` to be executed before `Warden::Manager`. It is already done in Decidim since v0.16

## Version 0.0.4 (PATCH)
- Remove Gemfile.lock to avoid problems with apps using this gem and solving devise vulneravility: https://github.com/plataformatec/devise/issues/4981.

Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ Omniauth's configuration is setted in `config/initializers/omniauth_idcat_mobil.

Refer to `omniauth-idcat_mobil` gem for further documentation.

## TODO
After decidim v0.16, remove from `lib/decidim/idcat_mobil/engine.rb:23` the `initializer "decidim.middleware"`.

## Contributing

See [Decidim](https://github.com/decidim/decidim).
Expand Down
2 changes: 1 addition & 1 deletion decidim-idcat_mobil.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Gem::Specification.new do |s|
s.files = Dir["{app,config,lib}/**/*", "LICENSE-AGPLv3.txt", "Rakefile", "README.md"]

s.add_dependency "omniauth-idcat_mobil", "~> 0.2.0"
DECIDIM_VERSION= ">= 0.13.1"
DECIDIM_VERSION= ">= 0.20.0"
s.add_dependency "decidim", DECIDIM_VERSION
s.add_dependency "decidim-core", DECIDIM_VERSION
s.add_development_dependency "decidim-dev", DECIDIM_VERSION
Expand Down
22 changes: 11 additions & 11 deletions lib/decidim/idcat_mobil/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ class Engine < ::Rails::Engine
# root to: "idcat_mobil#index"
end

#
# Force `Decidim::CurrentOrganization` to be executed before `Warden::Manager` to avoid path generation problems.
# NOTE: Remove this initializer when in Decidim 0.16.0 where it has been fixed.
#
initializer "decidim.middleware" do |app|
# as `app.config.middleware` is just a proxy made available for configuration purposes
# and acts as a command recorder that executes deletes always at the end
# we can not remove and re-insert, but only duplicate `Decidim::CurrentOrganization`.
# app.config.middleware.delete Decidim::CurrentOrganization
app.config.middleware.insert_before Warden::Manager, Decidim::CurrentOrganization
end
# #
# # Force `Decidim::CurrentOrganization` to be executed before `Warden::Manager` to avoid path generation problems.
# # NOTE: Remove this initializer when in Decidim 0.16.0 where it has been fixed.
# #
# initializer "decidim.middleware" do |app|
# # as `app.config.middleware` is just a proxy made available for configuration purposes
# # and acts as a command recorder that executes deletes always at the end
# # we can not remove and re-insert, but only duplicate `Decidim::CurrentOrganization`.
# # app.config.middleware.delete Decidim::CurrentOrganization
# app.config.middleware.insert_before Warden::Manager, Decidim::CurrentOrganization
# end

# initializer "decidim_idcat_mobil.assets" do |app|
# app.config.assets.precompile += %w[decidim_idcat_mobil_manifest.js decidim_idcat_mobil_manifest.css]
Expand Down
2 changes: 1 addition & 1 deletion lib/decidim/idcat_mobil/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Decidim
module IdcatMobil
def self.version
# See CHANGELOG.md to see what changed
"0.0.4"
"0.0.5"
end
end
end

0 comments on commit 740449b

Please sign in to comment.