views:

16

answers:

1

I'm doing this tutorial on how to reset a forgotten password. It all works, except there's just an empty line in the email where the URL is supposed to be that will take you to the page to reset the password. The line where it should be added doesn't really make sense to me. I can't work out what edit_password_reset_url(user.perishable_token) is actually referring to? Can someone explain it to me? Thanks for reading.

def password_reset_instructions(user)  
    subject       "Password Reset Instructions"  
    from          "Binary Logic Notifier "  
    recipients    user.email  
    sent_on       Time.now  
    body          :edit_password_reset_url => edit_password_reset_url(user.perishable_token)  
end
+1  A: 

Password resets are treated as resources that depend on perishable tokens (a token that can only be used once).

The URL that's being generated there will link to "reset your password" page for the user.

Offtopic: switch to Devise for auth if you want to avoid a lot of pain when integrating openid/oauth.

glebm
@glebm - Thanks for your answer. I'll look into Devise. Just wondering, where it the edit_password_reset_url method actually implemented? I haven't added it anywhere, which may be why I'm getting no link?
ben
oh, PasswordReset is coming from authlogic
glebm
the reason you don't see the link must be something else.what is the console output if you run this:`u = User.first; u.reset_perishable_token!; app.edit_password_reset_url(u.perishable_token)`
glebm
Worked it out, thanks so much for your help!
ben