Reputation: 4933
Is there an equivalent to the Authenticate method from RestfulAuthentication, like so?
@user = User.authenticate(@email, @password)
I have a custom controller i use for authenticating a mobile request, where the email/password come from the url, like http://localhost:3000/iphone/auth/[email protected]/mypassword
Upvotes: 10
Views: 5132
Reputation: 10412
Maybe you can use something like this:
user = User.find(:first, :conditions => ["email = ?", @email])
user.valid_password?(@password) unless user.nil?
Upvotes: 19