开发者

Rails + Devise - Authenticate method in custom controller

开发者 https://www.devze.com 2023-02-07 16:35 出处:网络
Is there an equivalent to the Authenticate method from RestfulAuthentication开发者_开发知识库, like so?

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

精彩评论

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