Skip to content

Commit

Permalink
Fix failing tests because of devise new version
Browse files Browse the repository at this point in the history
  • Loading branch information
sinaeftekhar committed Aug 11, 2023
1 parent e7e1892 commit ceb2717
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 101 deletions.
199 changes: 99 additions & 100 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PATH
decidim-apiauth (0.27.0)
decidim-api (~> 0.27.0)
decidim-core (~> 0.27.0)
devise-jwt (~> 0.9.0)
devise-jwt (~> 0.11.0)

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -158,53 +158,53 @@ GEM
db-query-matchers (0.10.0)
activesupport (>= 4.0, < 7)
rspec (~> 3.0)
decidim (0.27.1)
decidim-accountability (= 0.27.1)
decidim-admin (= 0.27.1)
decidim-api (= 0.27.1)
decidim-assemblies (= 0.27.1)
decidim-blogs (= 0.27.1)
decidim-budgets (= 0.27.1)
decidim-comments (= 0.27.1)
decidim-core (= 0.27.1)
decidim-debates (= 0.27.1)
decidim-forms (= 0.27.1)
decidim-generators (= 0.27.1)
decidim-meetings (= 0.27.1)
decidim-pages (= 0.27.1)
decidim-participatory_processes (= 0.27.1)
decidim-proposals (= 0.27.1)
decidim-sortitions (= 0.27.1)
decidim-surveys (= 0.27.1)
decidim-system (= 0.27.1)
decidim-templates (= 0.27.1)
decidim-verifications (= 0.27.1)
decidim-accountability (0.27.1)
decidim-comments (= 0.27.1)
decidim-core (= 0.27.1)
decidim-admin (0.27.1)
decidim (0.27.4)
decidim-accountability (= 0.27.4)
decidim-admin (= 0.27.4)
decidim-api (= 0.27.4)
decidim-assemblies (= 0.27.4)
decidim-blogs (= 0.27.4)
decidim-budgets (= 0.27.4)
decidim-comments (= 0.27.4)
decidim-core (= 0.27.4)
decidim-debates (= 0.27.4)
decidim-forms (= 0.27.4)
decidim-generators (= 0.27.4)
decidim-meetings (= 0.27.4)
decidim-pages (= 0.27.4)
decidim-participatory_processes (= 0.27.4)
decidim-proposals (= 0.27.4)
decidim-sortitions (= 0.27.4)
decidim-surveys (= 0.27.4)
decidim-system (= 0.27.4)
decidim-templates (= 0.27.4)
decidim-verifications (= 0.27.4)
decidim-accountability (0.27.4)
decidim-comments (= 0.27.4)
decidim-core (= 0.27.4)
decidim-admin (0.27.4)
active_link_to (~> 1.0)
decidim-core (= 0.27.1)
decidim-core (= 0.27.4)
devise (~> 4.7)
devise-i18n (~> 1.2)
devise_invitable (~> 2.0)
decidim-api (0.27.1)
decidim-api (0.27.4)
graphql (~> 1.12, < 1.13)
graphql-docs (~> 2.1.0)
rack-cors (~> 1.0)
decidim-assemblies (0.27.1)
decidim-core (= 0.27.1)
decidim-blogs (0.27.1)
decidim-admin (= 0.27.1)
decidim-comments (= 0.27.1)
decidim-core (= 0.27.1)
decidim-budgets (0.27.1)
decidim-comments (= 0.27.1)
decidim-core (= 0.27.1)
decidim-comments (0.27.1)
decidim-core (= 0.27.1)
decidim-assemblies (0.27.4)
decidim-core (= 0.27.4)
decidim-blogs (0.27.4)
decidim-admin (= 0.27.4)
decidim-comments (= 0.27.4)
decidim-core (= 0.27.4)
decidim-budgets (0.27.4)
decidim-comments (= 0.27.4)
decidim-core (= 0.27.4)
decidim-comments (0.27.4)
decidim-core (= 0.27.4)
redcarpet (~> 3.5, >= 3.5.1)
decidim-core (0.27.1)
decidim-core (0.27.4)
active_link_to (~> 1.0)
acts_as_list (~> 0.9)
batch-loader (~> 1.2)
Expand All @@ -214,7 +214,7 @@ GEM
cells-rails (~> 0.1.3)
charlock_holmes (~> 0.7)
date_validator (~> 0.12.0)
decidim-api (= 0.27.1)
decidim-api (= 0.27.4)
devise (~> 4.7)
devise-i18n (~> 1.2)
diffy (~> 3.3)
Expand All @@ -227,7 +227,7 @@ GEM
hashdiff (>= 0.4.0, < 2.0.0)
invisible_captcha (~> 0.12)
kaminari (~> 1.2, >= 1.2.1)
loofah (~> 2.3.1)
loofah (~> 2.19.0)
mime-types (>= 1.16, < 4.0)
mini_magick (~> 4.9)
mustache (~> 1.1.0)
Expand Down Expand Up @@ -255,15 +255,15 @@ GEM
webpacker (= 6.0.0.rc.5)
webpush (~> 1.1)
wisper (~> 2.0)
decidim-debates (0.27.1)
decidim-comments (= 0.27.1)
decidim-core (= 0.27.1)
decidim-dev (0.27.1)
decidim-debates (0.27.4)
decidim-comments (= 0.27.4)
decidim-core (= 0.27.4)
decidim-dev (0.27.4)
axe-core-rspec (~> 4.1.0)
byebug (~> 11.0)
capybara (~> 3.24)
db-query-matchers (~> 0.10.0)
decidim (= 0.27.1)
decidim (= 0.27.4)
erb_lint (~> 0.0.35)
factory_bot_rails (~> 4.8)
i18n-tasks (~> 0.9.18)
Expand All @@ -286,62 +286,62 @@ GEM
w3c_rspec_validators (~> 0.3.0)
webmock (~> 3.6)
wisper-rspec (~> 1.0)
decidim-forms (0.27.1)
decidim-core (= 0.27.1)
decidim-forms (0.27.4)
decidim-core (= 0.27.4)
wicked_pdf (~> 2.1)
wkhtmltopdf-binary (~> 0.12)
decidim-generators (0.27.1)
decidim-core (= 0.27.1)
decidim-meetings (0.27.1)
decidim-core (= 0.27.1)
decidim-forms (= 0.27.1)
decidim-generators (0.27.4)
decidim-core (= 0.27.4)
decidim-meetings (0.27.4)
decidim-core (= 0.27.4)
decidim-forms (= 0.27.4)
icalendar (~> 2.5)
decidim-pages (0.27.1)
decidim-core (= 0.27.1)
decidim-participatory_processes (0.27.1)
decidim-core (= 0.27.1)
decidim-proposals (0.27.1)
decidim-comments (= 0.27.1)
decidim-core (= 0.27.1)
decidim-pages (0.27.4)
decidim-core (= 0.27.4)
decidim-participatory_processes (0.27.4)
decidim-core (= 0.27.4)
decidim-proposals (0.27.4)
decidim-comments (= 0.27.4)
decidim-core (= 0.27.4)
doc2text (~> 0.4.5)
redcarpet (~> 3.5, >= 3.5.1)
decidim-sortitions (0.27.1)
decidim-admin (= 0.27.1)
decidim-comments (= 0.27.1)
decidim-core (= 0.27.1)
decidim-proposals (= 0.27.1)
decidim-surveys (0.27.1)
decidim-core (= 0.27.1)
decidim-forms (= 0.27.1)
decidim-templates (= 0.27.1)
decidim-system (0.27.1)
decidim-sortitions (0.27.4)
decidim-admin (= 0.27.4)
decidim-comments (= 0.27.4)
decidim-core (= 0.27.4)
decidim-proposals (= 0.27.4)
decidim-surveys (0.27.4)
decidim-core (= 0.27.4)
decidim-forms (= 0.27.4)
decidim-templates (= 0.27.4)
decidim-system (0.27.4)
active_link_to (~> 1.0)
decidim-core (= 0.27.1)
decidim-core (= 0.27.4)
devise (~> 4.7)
devise-i18n (~> 1.2)
devise_invitable (~> 2.0)
decidim-templates (0.27.1)
decidim-core (= 0.27.1)
decidim-forms (= 0.27.1)
decidim-verifications (0.27.1)
decidim-core (= 0.27.1)
decidim-templates (0.27.4)
decidim-core (= 0.27.4)
decidim-forms (= 0.27.4)
decidim-verifications (0.27.4)
decidim-core (= 0.27.4)
declarative-builder (0.1.0)
declarative-option (< 0.2.0)
declarative-option (0.1.0)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
devise (4.8.1)
devise (4.9.2)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0)
responders
warden (~> 1.2.3)
devise-i18n (1.10.2)
devise (>= 4.8.0)
devise-jwt (0.9.0)
devise-i18n (1.11.0)
devise (>= 4.9.0)
devise-jwt (0.11.0)
devise (~> 4.0)
warden-jwt_auth (~> 0.6)
devise_invitable (2.0.6)
warden-jwt_auth (~> 0.8)
devise_invitable (2.0.8)
actionmailer (>= 5.0)
devise (>= 4.6)
diff-lcs (1.5.0)
Expand All @@ -353,14 +353,13 @@ GEM
doorkeeper (5.6.6)
railties (>= 5)
doorkeeper-i18n (4.0.1)
dry-auto_inject (0.9.0)
dry-container (>= 0.3.4)
dry-configurable (0.16.1)
dry-core (~> 0.6)
dry-auto_inject (1.0.1)
dry-core (~> 1.0)
zeitwerk (~> 2.6)
dry-container (0.11.0)
concurrent-ruby (~> 1.0)
dry-core (0.9.1)
dry-configurable (1.1.0)
dry-core (~> 1.0, < 2)
zeitwerk (~> 2.6)
dry-core (1.0.1)
concurrent-ruby (~> 1.0)
zeitwerk (~> 2.6)
dumb_delegator (1.0.0)
Expand Down Expand Up @@ -452,7 +451,7 @@ GEM
invisible_captcha (0.13.0)
rails (>= 3.2.0)
json (2.6.3)
jwt (2.6.0)
jwt (2.7.1)
kaminari (1.2.2)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.2.2)
Expand Down Expand Up @@ -480,7 +479,7 @@ GEM
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.3.1)
loofah (2.19.1)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.8.1)
Expand Down Expand Up @@ -619,8 +618,8 @@ GEM
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.4.3)
loofah (~> 2.3)
rails-html-sanitizer (1.5.0)
loofah (~> 2.19, >= 2.19.1)
rails-i18n (6.0.0)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 7)
Expand All @@ -644,9 +643,9 @@ GEM
regexp_parser (2.8.1)
request_store (1.5.1)
rack (>= 1.4)
responders (3.0.1)
actionpack (>= 5.0)
railties (>= 5.0)
responders (3.1.0)
actionpack (>= 5.2)
railties (>= 5.2)
rexml (3.2.6)
rspec (3.12.0)
rspec-core (~> 3.12.0)
Expand Down Expand Up @@ -779,9 +778,9 @@ GEM
rexml (~> 3.2)
warden (1.2.9)
rack (>= 2.0.9)
warden-jwt_auth (0.7.0)
dry-auto_inject (~> 0.8)
dry-configurable (~> 0.13)
warden-jwt_auth (0.8.0)
dry-auto_inject (>= 0.8, < 2)
dry-configurable (>= 0.13, < 2)
jwt (~> 2.1)
warden (~> 1.2)
web-console (3.7.0)
Expand Down
2 changes: 1 addition & 1 deletion decidim-apiauth.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Gem::Specification.new do |spec|

spec.add_dependency "decidim-api", Decidim::Apiauth::DECIDIM_VERSION
spec.add_dependency "decidim-core", Decidim::Apiauth::DECIDIM_VERSION
spec.add_dependency "devise-jwt", "~> 0.9.0"
spec.add_dependency "devise-jwt", "~> 0.11.0"

spec.add_development_dependency "decidim-dev", Decidim::Apiauth::DECIDIM_VERSION
end
9 changes: 9 additions & 0 deletions lib/decidim/apiauth/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ class Engine < ::Rails::Engine
end

initializer "decidim_apiauth_customizations", after: "decidim.action_controller" do
# To be compatibale with Turbo, from Devise v.4.9.0 on, devise keep error status for validation as :ok, and sets
# the redirect_status as :found. However, these configuration options is devised to change this behavior as
# needed(for more information refer to https://github.com/heartcombo/devise/blob/v4.9.0/CHANGELOG.md#490---2023-02-17):
ActiveSupport.on_load(:devise_failure_app) do
Devise.setup do |config|
config.responder.error_status = :forbidden
end
end

config.to_prepare do
# Model extensions
Decidim::User.include Decidim::Apiauth::ApiAuthentication
Expand Down

0 comments on commit ceb2717

Please sign in to comment.