ben
ben

Reputation: 29797

Can someone please explain this line of code from a tutorial on how to reset a password with Authlogic?

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

Upvotes: 0

Views: 484

Answers (1)

glebm
glebm

Reputation: 21100

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.

Upvotes: 1

Related Questions