Skip to content
This repository has been archived by the owner on Aug 20, 2021. It is now read-only.

Commit

Permalink
Fix Single-Logout
Browse files Browse the repository at this point in the history
  • Loading branch information
pencil committed May 9, 2014
1 parent 1378383 commit 71b1a82
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/redmine_cas/application_controller_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module ApplicationControllerPatch
def self.included(base)
base.send(:include, InstanceMethods)
base.class_eval do
alias_method_chain :verify_authenticity_token, :cas
alias_method_chain :require_login, :cas
end
end
Expand Down Expand Up @@ -55,6 +56,18 @@ def login_with_cas
end
end

def verify_authenticity_token_with_cas
if cas_logout_request?
logger.info 'CAS logout request detected: Skipping validation of authenticity token'
else
verify_authenticity_token_without_cas
end
end

def cas_logout_request?
request.post? && params.has_key?('logoutRequest')
end

def cas_account_pending
render_403 :message => l(:notice_account_pending)
end
Expand Down

0 comments on commit 71b1a82

Please sign in to comment.