google-code-export / rubycas-client

Automatically exported from code.google.com/p/rubycas-client
1 stars 1 forks source link

TypeError (can't dup NilClass): #40

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When using the before_filter, I am successfully redirected to my CAS Server's 
authentication page; however, when it redirects me back, I get the following 
error:

Filter chain halted as [CASClient::Frameworks::Rails::Filter] 
rendered_or_redirected.

and then

Processing ProfileController#login (for 127.0.0.1 at 2010-07-14 20:59:15) [GET]
  Parameters: {"ticket"=>"ST-1279155555rA9691159F0C0A46CC6"}

TypeError (can't dup NilClass):

Any ideas? I thought I had to make a route to catch this and redirect, but that 
doesn't seem to be working.

Original issue reported on code.google.com by Pas...@gmail.com on 15 Jul 2010 at 1:00

GoogleCodeExporter commented 9 years ago

Original comment by matt.zuk...@gmail.com on 15 Jul 2010 at 6:58

GoogleCodeExporter commented 9 years ago
    def logout_url(destination_url = nil, follow_url = nil) 
      result = '' 
      url = @logout_url || (cas_base_url + "/logout") 
      if destination_url 
        # if present, remove the 'ticket' parameter from the 
destination_url 
        duri = URI.parse(destination_url) 
        h = duri.query ? query_to_hash(duri.query) : {} 
        h.delete('ticket') 
        duri.query = hash_to_query(h) 
        destination_url = duri.to_s.gsub(/\?$/, '') 
      end 
      if destination_url || follow_url 
        uri = URI.parse(url) 
        h = uri.query ? query_to_hash(uri.query) : {} 
        h['destination'] = destination_url if destination_url 
        h['url'] = follow_url if follow_url 
        uri.query = hash_to_query(h) 
        result = uri.to_s 
      else 
        result = url 
      end 
      result += '&gateway=1' 
      return result 
    end 

Original comment by soorya.s...@gmail.com on 8 Jan 2012 at 10:01