I have implemented restful authentication plugin in my rails application.
It’s a barebones implementation without activation, forget password features
…etc. I was wondering if it is possible to reset a User’s password from
the rails console? As things stand now, there is no other way to reset their
Haven’t used restful auth in a long long time, but you should be able
to do exactly what a controller would do when setting a password:
user.password = ‘imAdummy’
user.password_confirmation = ‘imAdummy’
The users table has crypted_password, and salt columns which is giving me problems when I try to reset password from the console.After reading the documentation for restful authentication, it appears that the I need to store the hashed password in crypted_password field. Therefore, I approached the problem as follows:
Loading development environment (Rails 2.3.5)
=> #<User id: 2, login: “admin”, name: “”, email: “firstname.lastname@example.org”, crypted_pas
sword: “b6fe78bbb5f6f1b2c7e6061a2e2a80bbdc538194”, salt: “502d171c369fac51309dd9
1aea49c9cabe9eed20”, created_at: “2010-05-17 08:54:44”, updated_at: “2010-05-17
09:21:30”, remember_token: nil, remember_token_expires_at: nil, admin: true>
Eventhough everything appears to go smoothly and also user.save returns “true”, I am unable to login as admin. Have I overlooked something?
Thanks in advance for your help