Reputation:
What I’d like to achieve is a typical use case: a user enters his email address into a form. After sending the form to my application an email with a random generated link should be sent out to the user which he has to click to confirm his email address. After clicking the link the address should be marked as valid in my application.
My main questions are:
Thanks :-).
Upvotes: 1
Views: 790
Reputation: 6436
Like @apneadiving and @Brian pointed out you have that feature in Devise and AuthLogic, but in case you need to roll out your what better way than to learn from them:
The logic is to generate a random token (md5, sha1, whatever..) store it and send it. When your confirmations controller is called you accept the confirmation for the token passed as param.
Upvotes: 2
Reputation: 115521
It's also provided out of the box in Devise: https://github.com/plataformatec/devise
See confirmable
option.
Upvotes: 6