Skip to content

Commit

Permalink
Let's try this instead
Browse files Browse the repository at this point in the history
  • Loading branch information
Nat Budin committed Jan 15, 2013
1 parent 7127622 commit 130aab2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ DEPENDENCIES
mocha
pry
rails (>= 3.0.7)
rspec-rails (>= 2.6.1)
rspec-rails
sham_rack
shoulda
sqlite3-ruby
10 changes: 6 additions & 4 deletions app/controllers/devise/cas_sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ def destroy
service_url << request.host
service_url << ":#{request.port.to_s}" unless request.port == 80

logout_url = case ::Devise.cas_client.method(:logout_url).arity
when 3 then ::Devise.cas_client.logout_url(destination_url, follow_url, ::Devise.cas_service_url(service_url, devise_mapping))
else ::Devise.cas_client.logout_url(destination_url, follow_url)
logout_url = begin
::Devise.cas_client.logout_url(destination_url, follow_url, ::Devise.cas_service_url(service_url, devise_mapping))
rescue ArgumentError
# Older rubycas-clients don't accept a service_url
::Devise.cas_client.logout_url(destination_url, follow_url)
end

redirect_to(logout_url)
Expand Down Expand Up @@ -123,4 +125,4 @@ def cas_login_url
::Devise.cas_client.add_service_to_login_url(::Devise.cas_service_url(request.url, devise_mapping))
end
helper_method :cas_login_url
end
end

0 comments on commit 130aab2

Please sign in to comment.