Skip to content

Commit

Permalink
Change sign out page for odoo users
Browse files Browse the repository at this point in the history
  • Loading branch information
fblupi committed May 16, 2024
1 parent 248eddd commit 148817f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# frozen_string_literal: true

module Decidim
module Devise
module SessionsControllerOverride
extend ActiveSupport::Concern

included do
alias_method :original_after_sign_out_path_for, :after_sign_out_path_for
alias_method :original_destroy, :destroy

def destroy
@user = current_user
original_destroy
end

def after_sign_out_path_for(resource)
if @user.odoo_identity?
"https://oficinavirtual.somconnexio.coop"
else
original_after_sign_out_path_for(resource)
end
end
end
end
end
end
1 change: 1 addition & 0 deletions config/initializers/decidim_overrides.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Decidim::ActionDelegator::Verifications::DelegationsVerifier::AuthorizationsController.include(
Decidim::ActionDelegator::Verifications::DelegationsVerifier::AuthorizationsControllerOverride
)
Decidim::Devise::SessionsController.include(Decidim::Devise::SessionsControllerOverride)
Decidim::ActionDelegator::Setting.include(Decidim::ActionDelegator::SettingOverride)
Decidim::ActionDelegator::Verifications::DelegationsAuthorizer.include(Decidim::ActionDelegator::Verifications::DelegationsAuthorizerOverride)
Decidim::Odoo::Verifications::OdooMember.include(Decidim::Odoo::Verifications::OdooMemberOverride)
Expand Down
1 change: 1 addition & 0 deletions spec/lib/overrides_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
{
package: "decidim-core",
files: {
"/app/controllers/decidim/devise/sessions_controller.rb" => "235cbe9844cdd39f65c72d3dc87f5f23",
"/app/views/layouts/decidim/_head_extra.html.erb" => "1b8237357754cf519f4e418135f78440"
}
},
Expand Down

0 comments on commit 148817f

Please sign in to comment.