When I amended my registration page, I included the digest to encrypt
the password in the database.

If someone forgets their password, how do I get this mailed back to
the user?

The action is as follows:



  def remind

        @title = "Remind Me!"

if param_posted?(:user)

            email = params[:user][:email]

            user = User.find_by_email(email)

             If user

             UserMailer.deliver_reminder(@user)

             flash[:notice] = "Reminder sent."

             redirect_to :action => "index", :controller => "site"

             else

               flash[:notice] = "There is no user with that email
address."

             end

  end

end

This then calls the reminder part of UserMailer.deliver and sends the
user their username and password.

This template shows… Hello, You have just requested your login
details. Please see below:


Username: <%= @user.username %

Password: <%= @user.password %>

Thing is, with the password, as-is, it just prints the encrypted
string, so is no use to a user.

AT the moment I only mail out the username, as the password at the
moment isn’t helpful.

 Is there a way to decrypt for the purposes of reminding someone?

Many Thanks... :-)

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to