Skip to content

Commit

Permalink
added documentation on how to not require a login when using openid
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Reinsch committed Mar 18, 2010
1 parent 7aa9719 commit 1134b75
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,25 @@ You should save your @user objects this way as well, because you also want the u

Notice we are saving with a block. Why? Because we need to redirect the user to their OpenID provider so that they can authenticate. When we do this, we don't want to execute that block of code, because if we do, we will get a DoubleRender error. This lets us skip that entire block and send the user along their way without any problems.

=== 5. Check your validations / Auto registration

In case you want to enable automatic user registrations with OpenID, enable this in your session:

class UserSession < Authlogic::Session::Base
auto_register
end

In this case you migth also want to change the user object to no longer require a login:

class User < ActiveRecord::Base
acts_as_authentic do |c|
c.merge_validates_length_of_login_field_options(:unless => :using_openid?)
c.merge_validates_format_of_login_field_options(:unless => :using_openid?)
end
end

=== 6. Done!

That's it! The rest is taken care of for you.

== Redirecting from the models?
Expand Down

0 comments on commit 1134b75

Please sign in to comment.