开发者

Rails + Devise - Authenticate method in custom controller

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/frexuz@frexuz.com/mypassword


Maybe you can use something like this:

user = User.find(:first, :conditions => ["email = ?", @email])
user.valid_password?(@password) unless user.nil?
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜