rbCAS / CASino

CASino is a Ruby-based Single Sign-On solution supporting the CAS standard
MIT License
329 stars 189 forks source link

Render and/or redirect were called multiple times in this action #142

Closed janhh closed 8 years ago

janhh commented 8 years ago

I am setting up a CAS server with CASino (4.0.2) in Rails (4.2.5). The client is phpCAS 1.3.4+ and Drupal 7. I use Ruby 2.2.2. I hit some redirect issues as shown in attached screenshot.

screenshot - 11192015 - 02 48 26 pm

I believe there are missing return statements in the SessionsController. After adding the following decorator into my project for overriding new() it looks like I avoid the errors.

CASino::SessionsController.class_eval do
  def new
    tgt = current_ticket_granting_ticket
    unless params[:renew] || tgt.nil?
      handle_signed_in(tgt)
      return
    end
    if params[:gateway] && params[:service].present?
      redirect_to(params[:service])
      return
    end
  end
end