Skip to content

Commit

Permalink
address change in Rails 3 path_parameters key format
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Mell committed Nov 3, 2011
1 parent 8cd5494 commit e1be907
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions examples/rails_openid/app/controllers/consumer_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def start
end
return_to = url_for :action => 'complete', :only_path => false
realm = url_for :action => 'index', :id => nil, :only_path => false

if oidreq.send_redirect?(realm, return_to, params[:immediate])
redirect_to oidreq.redirect_url(realm, return_to, params[:immediate])
else
Expand All @@ -58,7 +58,10 @@ def start
def complete
# FIXME - url_for some action is not necessarily the current URL.
current_url = url_for(:action => 'complete', :only_path => false)
parameters = params.reject{|k,v|request.path_parameters[k]}
parameters = params.reject { |k,v|
# params keys are String; Rails 3.1 path_parameters keys are Symbol
request.path_parameters[k.to_sym]
}
oidresp = consumer.complete(parameters, current_url)
case oidresp.status
when OpenID::Consumer::FAILURE
Expand Down

0 comments on commit e1be907

Please sign in to comment.