Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add user auth #5

Closed
happypeter opened this issue Sep 26, 2012 · 2 comments
Closed

Add user auth #5

happypeter opened this issue Sep 26, 2012 · 2 comments

Comments

@happypeter
Copy link
Owner

This time rails3.1 gives us has_secure_password, things get much sweeter!

http://railscasts.com/episodes/250-authentication-from-scratch-revised?autoplay=true

@happypeter
Copy link
Owner Author

注意使用 has_secure_password 的时候要注意数据库里是否有 password_digest, 另外就是 form 中 password_comfirmation 的提交 id 的名字也要标准, 不然密码匹配检测不会运行。

happypeter added a commit that referenced this issue Sep 26, 2012
@happypeter
Copy link
Owner Author

-    <%= label_tag :passward %><br />
-    <%= password_field_tag :passward %>
+    <%= label_tag :password %><br />
+    <%= password_field_tag :password %>

if you have passward in your login form, you won't get a error, well, when you submit the form, you see

 "passward"=>"111111",

when it should be

 "password"=>"[filtered]",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant