-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
app/controllers/concerns/decidim/devise/sessions_controller_override.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters