Forum: Ruby on Rails Retriving password,if users forgot password

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1dfaf20024262ea08d10f06105290129?d=identicon&s=25 sharmila devi (Guest)
on 2006-05-16 12:18
(Received via mailing list)
hi rails gals and guys
   im creating authentication using username and password,i wants to
know how to retrive the username and  password,if user forgot the
username and password by asking secret question and secret answer
  e.g : what is your pet's name?

  if anyone knows how to implement tis,plz send your suggestions and
ideas.

  N.C.Sharmila
F15fdc7cb2e911b3808837f2be244add?d=identicon&s=25 Adam Denenberg (Guest)
on 2006-05-16 14:42
(Received via mailing list)
i would just create a separate db table for this. Generate some sort of
md5
hash and urlencode it into a "click here to create new password" link in
the
app.

when user clicks the url in the email they got,  rails matches the md5
string in the URL against an entry in the DB.  If its there, delete the
record , update user with a temp pass in the user table, and email it to
the
user.

Make sure to clean up the table every few days.  IF they dont update
their
pass those records should be purged frequently.

adam
This topic is locked and can not be replied to.