Permalink
Browse files

make sure there is a _method=post in the params, so there won't be an…

… issue with restful routes
  • Loading branch information...
1 parent 761d721 commit 4d1fed2f51feef23b25675d78289073621ed60b7 @mreinsch mreinsch committed Mar 18, 2010
Showing with 12 additions and 6 deletions.
  1. +6 −5 lib/authlogic_openid/acts_as_authentic.rb
  2. +6 −1 lib/authlogic_openid/session.rb
View
11 lib/authlogic_openid/acts_as_authentic.rb
@@ -86,11 +86,12 @@ def authenticate_with_openid
map_saved_attributes(session_class.controller.session[:openid_attributes])
session_class.controller.session[:openid_attributes] = nil
end
-
- options = {}
- options[:required] = self.class.openid_required_fields
- options[:optional] = self.class.openid_optional_fields
- options[:return_to] = session_class.controller.url_for(:for_model => "1")
+
+ options = {
+ :required => self.class.openid_required_fields,
+ :optional => self.class.openid_optional_fields,
+ :return_to => session_class.controller.url_for(:for_model => "1"),
+ :method => :post }
session_class.controller.send(:authenticate_with_open_id, openid_identifier, options) do |result, openid_identifier, registration|
if result.unsuccessful?
View
7 lib/authlogic_openid/session.rb
@@ -73,7 +73,12 @@ def find_by_openid_identifier_method
def validate_by_openid
self.remember_me = controller.params[:remember_me] == "true" if controller.params.key?(:remember_me)
- controller.send(:authenticate_with_open_id, openid_identifier, :return_to => controller.url_for(:for_session => "1", :remember_me => remember_me?)) do |result, openid_identifier|
+
+ options = {
+ :return_to => controller.url_for(:for_session => "1", :remember_me => remember_me?),
+ :method => :post}
+
+ controller.send(:authenticate_with_open_id, openid_identifier, options) do |result, openid_identifier|
if result.unsuccessful?
errors.add_to_base(result.message)
return

0 comments on commit 4d1fed2

Please sign in to comment.