In Rails, what is the "API" of Restful Authentication?
Using Restful Authentication ( https://github.com/technoweenie/restful-authentication ), is there an API for all the methods it adds开发者_高级运维 to a Rails project?
So far, I found
current_user # returns a User object of current logged in user, nil if none
logged_in? # returns true/false whether there is a logged in user
before_filter :login_required # if no logged in user, redirects to the login page
Is there a complete list of methods / API available? In the old days, we always have a complete list of methods / functions we can call, but sometimes in Rails, I find information is somewhat scattered around.
Here's the documentation of all methods in the project: http://rdoc.info/github/technoweenie/restful-authentication
The wiki is quite good as well: https://github.com/technoweenie/restful-authentication/wiki
Alternatives for Rails 2.3 and 3.0
- Authlogic: https://github.com/binarylogic/authlogic
- Devise: https://github.com/plataformatec/devise
I have used Restful-Authentication, Authlogic, and Devise. Based upon feedback from the rails community, I would encourage you to look at Devise. I recently switched one of my Rails 1.2.5 applications using Restful-Authentication into a Rails 3.x application using Devise. Using Devise was much easier than Restful-Authentication. (I know this doesn't answer you immediate question, but I wished someone told me this when I was doing my selection.)
精彩评论